Package org.camunda.bpm.model.xml.impl
Class ModelImpl
java.lang.Object
org.camunda.bpm.model.xml.impl.ModelImpl
- All Implemented Interfaces:
Model
A model contains all defined types and the relationship between them.
- Author:
- Daniel Meyer
-
Field Summary
FieldsModifier and TypeFieldDescription -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddeclareAlternativeNamespace(String alternativeNs, String actualNs) Declares an alternative namespace for an actual so that during lookup of elements/attributes both will be considered.booleangetActualNamespace(String alternativeNs) Returns the actual namespace URI for an alternative namespace URIgetAlternativeNamespace(String actualNs) Returns the alternative namespace URI for a namespace URIgetAlternativeNamespaces(String actualNs) Returns the model name, which is the identifier of this model.getType(Class<? extends ModelElementInstance> instanceClass) Gets the definedModelElementTypeof aModelElementInstance.getTypeForName(String typeName) Gets the definedModelElementTypefor a type by its name.getTypeForName(String namespaceUri, String typeName) Gets the definedModelElementTypefor a type by its name and namespace URI.getTypes()Gets the collection of allModelElementTypedefined in the model.inthashCode()voidregisterType(ModelElementType modelElementType, Class<? extends ModelElementInstance> instanceType) Registers aModelElementTypein thisModel.voidundeclareAlternativeNamespace(String alternativeNs)
-
Field Details
-
actualNsToAlternative
-
alternativeNsToActual
-
-
Constructor Details
-
ModelImpl
Create a newModelwith a model name.- Parameters:
modelName- the model name to identify the model
-
-
Method Details
-
declareAlternativeNamespace
Declares an alternative namespace for an actual so that during lookup of elements/attributes both will be considered. This can be used if a newer namespaces replaces an older one but XML files with the old one should still be parseable.- Parameters:
alternativeNs-actualNs-- Throws:
IllegalArgumentException- if the alternative is already used or if the actual namespace has an alternative
-
undeclareAlternativeNamespace
-
getAlternativeNamespaces
- Specified by:
getAlternativeNamespacesin interfaceModel
-
getAlternativeNamespace
Description copied from interface:ModelReturns the alternative namespace URI for a namespace URI- Specified by:
getAlternativeNamespacein interfaceModel- Parameters:
actualNs- the actual namespace URI- Returns:
- the alternative namespace URI or null if none is set
-
getActualNamespace
Description copied from interface:ModelReturns the actual namespace URI for an alternative namespace URI- Specified by:
getActualNamespacein interfaceModel- Parameters:
alternativeNs- the alternative namespace URI- Returns:
- the actual namespace URI or null if none is set
-
getTypes
Description copied from interface:ModelGets the collection of allModelElementTypedefined in the model. -
getType
Description copied from interface:ModelGets the definedModelElementTypeof aModelElementInstance. -
getTypeForName
Description copied from interface:ModelGets the definedModelElementTypefor a type by its name.- Specified by:
getTypeForNamein interfaceModel- Parameters:
typeName- the name of the type- Returns:
- the element type or null if no type is defined for the name
-
getTypeForName
Description copied from interface:ModelGets the definedModelElementTypefor a type by its name and namespace URI.- Specified by:
getTypeForNamein interfaceModel- Parameters:
namespaceUri- the namespace URI for the typetypeName- the name of the type- Returns:
- the element type or null if no type is defined for the name and namespace URI
-
registerType
public void registerType(ModelElementType modelElementType, Class<? extends ModelElementInstance> instanceType) Registers aModelElementTypein thisModel.- Parameters:
modelElementType- the element type to registerinstanceType- the instance class of the type to register
-
getModelName
Description copied from interface:ModelReturns the model name, which is the identifier of this model.- Specified by:
getModelNamein interfaceModel- Returns:
- the model name
-
hashCode
public int hashCode() -
equals
-