Package org.camunda.bpm.model.xml.impl
Class ModelImpl
- java.lang.Object
-
- org.camunda.bpm.model.xml.impl.ModelImpl
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.Map<java.lang.String,java.util.Set<java.lang.String>>actualNsToAlternativeprotected java.util.Map<java.lang.String,java.lang.String>alternativeNsToActual
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddeclareAlternativeNamespace(java.lang.String alternativeNs, java.lang.String actualNs)Declares an alternative namespace for an actual so that during lookup of elements/attributes both will be considered.booleanequals(java.lang.Object obj)java.lang.StringgetActualNamespace(java.lang.String alternativeNs)Returns the actual namespace URI for an alternative namespace URIjava.lang.StringgetAlternativeNamespace(java.lang.String actualNs)Returns the alternative namespace URI for a namespace URIjava.util.Set<java.lang.String>getAlternativeNamespaces(java.lang.String actualNs)java.lang.StringgetModelName()Returns the model name, which is the identifier of this model.ModelElementTypegetType(java.lang.Class<? extends ModelElementInstance> instanceClass)Gets the definedModelElementTypeof aModelElementInstance.ModelElementTypegetTypeForName(java.lang.String typeName)Gets the definedModelElementTypefor a type by its name.ModelElementTypegetTypeForName(java.lang.String namespaceUri, java.lang.String typeName)Gets the definedModelElementTypefor a type by its name and namespace URI.java.util.Collection<ModelElementType>getTypes()Gets the collection of allModelElementTypedefined in the model.inthashCode()voidregisterType(ModelElementType modelElementType, java.lang.Class<? extends ModelElementInstance> instanceType)Registers aModelElementTypein thisModel.voidundeclareAlternativeNamespace(java.lang.String alternativeNs)
-
-
-
Constructor Detail
-
ModelImpl
public ModelImpl(java.lang.String modelName)
Create a newModelwith a model name.- Parameters:
modelName- the model name to identify the model
-
-
Method Detail
-
declareAlternativeNamespace
public void declareAlternativeNamespace(java.lang.String alternativeNs, java.lang.String actualNs)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:
java.lang.IllegalArgumentException- if the alternative is already used or if the actual namespace has an alternative
-
undeclareAlternativeNamespace
public void undeclareAlternativeNamespace(java.lang.String alternativeNs)
-
getAlternativeNamespaces
public java.util.Set<java.lang.String> getAlternativeNamespaces(java.lang.String actualNs)
- Specified by:
getAlternativeNamespacesin interfaceModel
-
getAlternativeNamespace
public java.lang.String getAlternativeNamespace(java.lang.String actualNs)
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
public java.lang.String getActualNamespace(java.lang.String alternativeNs)
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
public java.util.Collection<ModelElementType> getTypes()
Description copied from interface:ModelGets the collection of allModelElementTypedefined in the model.
-
getType
public ModelElementType getType(java.lang.Class<? extends ModelElementInstance> instanceClass)
Description copied from interface:ModelGets the definedModelElementTypeof aModelElementInstance.
-
getTypeForName
public ModelElementType getTypeForName(java.lang.String typeName)
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
public ModelElementType getTypeForName(java.lang.String namespaceUri, java.lang.String typeName)
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, java.lang.Class<? extends ModelElementInstance> instanceType)
Registers aModelElementTypein thisModel.- Parameters:
modelElementType- the element type to registerinstanceType- the instance class of the type to register
-
getModelName
public java.lang.String 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()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
-