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 Map<String,Set<String>>
actualNsToAlternative
protected Map<String,String>
alternativeNsToActual
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
declareAlternativeNamespace(String alternativeNs, String actualNs)
Declares an alternative namespace for an actual so that during lookup of elements/attributes both will be considered.boolean
equals(Object obj)
String
getActualNamespace(String alternativeNs)
Returns the actual namespace URI for an alternative namespace URIString
getAlternativeNamespace(String actualNs)
Returns the alternative namespace URI for a namespace URISet<String>
getAlternativeNamespaces(String actualNs)
String
getModelName()
Returns the model name, which is the identifier of this model.ModelElementType
getType(Class<? extends ModelElementInstance> instanceClass)
Gets the definedModelElementType
of aModelElementInstance
.ModelElementType
getTypeForName(String typeName)
Gets the definedModelElementType
for a type by its name.ModelElementType
getTypeForName(String namespaceUri, String typeName)
Gets the definedModelElementType
for a type by its name and namespace URI.Collection<ModelElementType>
getTypes()
Gets the collection of allModelElementType
defined in the model.int
hashCode()
void
registerType(ModelElementType modelElementType, Class<? extends ModelElementInstance> instanceType)
Registers aModelElementType
in thisModel
.void
undeclareAlternativeNamespace(String alternativeNs)
-
-
-
Method Detail
-
declareAlternativeNamespace
public void declareAlternativeNamespace(String alternativeNs, 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:
IllegalArgumentException
- if the alternative is already used or if the actual namespace has an alternative
-
undeclareAlternativeNamespace
public void undeclareAlternativeNamespace(String alternativeNs)
-
getAlternativeNamespaces
public Set<String> getAlternativeNamespaces(String actualNs)
- Specified by:
getAlternativeNamespaces
in interfaceModel
-
getAlternativeNamespace
public String getAlternativeNamespace(String actualNs)
Description copied from interface:Model
Returns the alternative namespace URI for a namespace URI- Specified by:
getAlternativeNamespace
in interfaceModel
- Parameters:
actualNs
- the actual namespace URI- Returns:
- the alternative namespace URI or null if none is set
-
getActualNamespace
public String getActualNamespace(String alternativeNs)
Description copied from interface:Model
Returns the actual namespace URI for an alternative namespace URI- Specified by:
getActualNamespace
in interfaceModel
- Parameters:
alternativeNs
- the alternative namespace URI- Returns:
- the actual namespace URI or null if none is set
-
getTypes
public Collection<ModelElementType> getTypes()
Description copied from interface:Model
Gets the collection of allModelElementType
defined in the model.
-
getType
public ModelElementType getType(Class<? extends ModelElementInstance> instanceClass)
Description copied from interface:Model
Gets the definedModelElementType
of aModelElementInstance
.
-
getTypeForName
public ModelElementType getTypeForName(String typeName)
Description copied from interface:Model
Gets the definedModelElementType
for a type by its name.- Specified by:
getTypeForName
in 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(String namespaceUri, String typeName)
Description copied from interface:Model
Gets the definedModelElementType
for a type by its name and namespace URI.- Specified by:
getTypeForName
in 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 aModelElementType
in thisModel
.- Parameters:
modelElementType
- the element type to registerinstanceType
- the instance class of the type to register
-
getModelName
public String getModelName()
Description copied from interface:Model
Returns the model name, which is the identifier of this model.- Specified by:
getModelName
in interfaceModel
- Returns:
- the model name
-
-