Class ModelElementTypeImpl
- java.lang.Object
-
- org.camunda.bpm.model.xml.impl.type.ModelElementTypeImpl
-
- All Implemented Interfaces:
ModelElementType
public class ModelElementTypeImpl extends java.lang.Object implements ModelElementType
- Author:
- Daniel Meyer
-
-
Constructor Summary
Constructors Constructor Description ModelElementTypeImpl(ModelImpl model, java.lang.String name, java.lang.Class<? extends ModelElementInstance> instanceType)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected ModelElementInstance
createModelElementInstance(ModelTypeInstanceContext instanceContext)
boolean
equals(java.lang.Object obj)
java.util.Collection<Attribute<?>>
getAllAttributes()
Returns a list of all attributes, including the attributes of all base types.java.util.List<ChildElementCollection<?>>
getAllChildElementCollections()
java.util.List<ModelElementType>
getAllChildElementTypes()
java.util.Collection<ModelElementType>
getAllExtendingTypes()
Attribute<?>
getAttribute(java.lang.String attributeName)
Return the attribute for the attribute namejava.util.List<Attribute<?>>
getAttributes()
ModelElementType
getBaseType()
ChildElementCollection<?>
getChildElementCollection(ModelElementType childElementType)
java.util.List<ChildElementCollection<?>>
getChildElementCollections()
java.util.List<ModelElementType>
getChildElementTypes()
protected java.util.List<DomElement>
getElementsByNameNs(DomDocument document, java.lang.String namespaceURI)
java.util.Collection<ModelElementType>
getExtendingTypes()
java.util.Collection<ModelElementInstance>
getInstances(ModelInstance modelInstance)
java.lang.Class<? extends ModelElementInstance>
getInstanceType()
Model
getModel()
java.lang.String
getTypeName()
java.lang.String
getTypeNamespace()
int
hashCode()
boolean
isAbstract()
boolean
isBaseTypeOf(ModelElementType elementType)
Test if a element type is a base type of this type.ModelElementInstance
newInstance(ModelInstanceImpl modelInstance, DomElement domElement)
ModelElementInstance
newInstance(ModelInstance modelInstance)
void
registerAttribute(Attribute<?> attribute)
void
registerChildElementCollection(ChildElementCollection<?> childElementCollection)
void
registerChildElementType(ModelElementType childElementType)
void
registerExtendingType(ModelElementType modelType)
void
resolveBaseTypes(java.util.List<ModelElementType> baseTypes)
Resolve all types which are base types of this typevoid
resolveExtendingTypes(java.util.Set<ModelElementType> allExtendingTypes)
Resolve all types recursively which are extending this typevoid
setAbstract(boolean isAbstract)
void
setBaseType(ModelElementTypeImpl baseType)
void
setInstanceProvider(ModelElementTypeBuilder.ModelTypeInstanceProvider<?> instanceProvider)
void
setTypeNamespace(java.lang.String typeNamespace)
-
-
-
Constructor Detail
-
ModelElementTypeImpl
public ModelElementTypeImpl(ModelImpl model, java.lang.String name, java.lang.Class<? extends ModelElementInstance> instanceType)
-
-
Method Detail
-
newInstance
public ModelElementInstance newInstance(ModelInstance modelInstance)
- Specified by:
newInstance
in interfaceModelElementType
-
newInstance
public ModelElementInstance newInstance(ModelInstanceImpl modelInstance, DomElement domElement)
-
registerAttribute
public void registerAttribute(Attribute<?> attribute)
-
registerChildElementType
public void registerChildElementType(ModelElementType childElementType)
-
registerChildElementCollection
public void registerChildElementCollection(ChildElementCollection<?> childElementCollection)
-
registerExtendingType
public void registerExtendingType(ModelElementType modelType)
-
createModelElementInstance
protected ModelElementInstance createModelElementInstance(ModelTypeInstanceContext instanceContext)
-
getAttributes
public final java.util.List<Attribute<?>> getAttributes()
- Specified by:
getAttributes
in interfaceModelElementType
-
getTypeName
public java.lang.String getTypeName()
- Specified by:
getTypeName
in interfaceModelElementType
-
getInstanceType
public java.lang.Class<? extends ModelElementInstance> getInstanceType()
- Specified by:
getInstanceType
in interfaceModelElementType
-
setTypeNamespace
public void setTypeNamespace(java.lang.String typeNamespace)
-
getTypeNamespace
public java.lang.String getTypeNamespace()
- Specified by:
getTypeNamespace
in interfaceModelElementType
-
setBaseType
public void setBaseType(ModelElementTypeImpl baseType)
-
setInstanceProvider
public void setInstanceProvider(ModelElementTypeBuilder.ModelTypeInstanceProvider<?> instanceProvider)
-
isAbstract
public boolean isAbstract()
- Specified by:
isAbstract
in interfaceModelElementType
-
setAbstract
public void setAbstract(boolean isAbstract)
-
getExtendingTypes
public java.util.Collection<ModelElementType> getExtendingTypes()
- Specified by:
getExtendingTypes
in interfaceModelElementType
-
getAllExtendingTypes
public java.util.Collection<ModelElementType> getAllExtendingTypes()
- Specified by:
getAllExtendingTypes
in interfaceModelElementType
-
resolveExtendingTypes
public void resolveExtendingTypes(java.util.Set<ModelElementType> allExtendingTypes)
Resolve all types recursively which are extending this type- Parameters:
allExtendingTypes
- set of calculated extending types
-
resolveBaseTypes
public void resolveBaseTypes(java.util.List<ModelElementType> baseTypes)
Resolve all types which are base types of this type- Parameters:
baseTypes
- list of calculated base types
-
getBaseType
public ModelElementType getBaseType()
- Specified by:
getBaseType
in interfaceModelElementType
-
getModel
public Model getModel()
- Specified by:
getModel
in interfaceModelElementType
-
getChildElementTypes
public java.util.List<ModelElementType> getChildElementTypes()
- Specified by:
getChildElementTypes
in interfaceModelElementType
-
getAllChildElementTypes
public java.util.List<ModelElementType> getAllChildElementTypes()
- Specified by:
getAllChildElementTypes
in interfaceModelElementType
-
getChildElementCollections
public java.util.List<ChildElementCollection<?>> getChildElementCollections()
-
getAllChildElementCollections
public java.util.List<ChildElementCollection<?>> getAllChildElementCollections()
-
getInstances
public java.util.Collection<ModelElementInstance> getInstances(ModelInstance modelInstance)
- Specified by:
getInstances
in interfaceModelElementType
-
getElementsByNameNs
protected java.util.List<DomElement> getElementsByNameNs(DomDocument document, java.lang.String namespaceURI)
-
isBaseTypeOf
public boolean isBaseTypeOf(ModelElementType elementType)
Test if a element type is a base type of this type. So this type extends the given element type.- Parameters:
elementType
- the element type to test- Returns:
- true if
childElementTypeClass
is a base type of this type, else otherwise
-
getAllAttributes
public java.util.Collection<Attribute<?>> getAllAttributes()
Returns a list of all attributes, including the attributes of all base types.- Returns:
- the list of all attributes
-
getAttribute
public Attribute<?> getAttribute(java.lang.String attributeName)
Return the attribute for the attribute name- Specified by:
getAttribute
in interfaceModelElementType
- Parameters:
attributeName
- the name of the attribute- Returns:
- the attribute or null if it not exists
-
getChildElementCollection
public ChildElementCollection<?> getChildElementCollection(ModelElementType childElementType)
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
-