Class ChildElementCollectionImpl<T extends ModelElementInstance>
- java.lang.Object
-
- org.camunda.bpm.model.xml.impl.type.child.ChildElementCollectionImpl<T>
-
- All Implemented Interfaces:
ChildElementCollection<T>
- Direct Known Subclasses:
ChildElementImpl
public class ChildElementCollectionImpl<T extends ModelElementInstance> extends java.lang.Object implements ChildElementCollection<T>
This collection is a view on an the children of a Model Element.
- Author:
- Daniel Meyer
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.Class<T>
childElementTypeClass
protected int
maxOccurs
the maximum count of child elements in the collection.
-
Constructor Summary
Constructors Constructor Description ChildElementCollectionImpl(java.lang.Class<T> childElementTypeClass, ModelElementTypeImpl parentElementType)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Collection<T>
get(ModelElementInstance element)
returns aCollection
containing all or a subset of the child elements of aModelElementInstance
.ModelElementType
getChildElementType(Model model)
Get the model element type of the elements contained in this collection.java.lang.Class<T>
getChildElementTypeClass()
Get the class of the elements contained in this collection.int
getMaxOccurs()
Indicates the max element count of a collection.int
getMinOccurs()
Indicates the minimal element count of a collection.ModelElementType
getParentElementType()
Get the model element type of the element owns the collectionboolean
isImmutable()
Indicates whether the collection is immutable.void
setImmutable()
void
setMaxOccurs(int maxOccurs)
void
setMinOccurs(int minOccurs)
void
setMutable(boolean isMutable)
-
-
-
Field Detail
-
childElementTypeClass
protected final java.lang.Class<T extends ModelElementInstance> childElementTypeClass
-
maxOccurs
protected int maxOccurs
the maximum count of child elements in the collection. An unbounded collection has a negative maxOccurs.
-
-
Constructor Detail
-
ChildElementCollectionImpl
public ChildElementCollectionImpl(java.lang.Class<T> childElementTypeClass, ModelElementTypeImpl parentElementType)
-
-
Method Detail
-
setImmutable
public void setImmutable()
-
setMutable
public void setMutable(boolean isMutable)
-
isImmutable
public boolean isImmutable()
Description copied from interface:ChildElementCollection
Indicates whether the collection is immutable. If the collection is immutable, all state-altering operations such asCollection.add(Object)
orCollection.remove(Object)
will throw anUnsupportedOperationException
.- Specified by:
isImmutable
in interfaceChildElementCollection<T extends ModelElementInstance>
- Returns:
- true if the collection is mutable, false otherwise.
-
getMinOccurs
public int getMinOccurs()
Description copied from interface:ChildElementCollection
Indicates the minimal element count of a collection. Returns a positive integer or '0'.- Specified by:
getMinOccurs
in interfaceChildElementCollection<T extends ModelElementInstance>
- Returns:
- the minimal element count of the collection.
-
setMinOccurs
public void setMinOccurs(int minOccurs)
-
getMaxOccurs
public int getMaxOccurs()
Description copied from interface:ChildElementCollection
Indicates the max element count of a collection. In a negative value is returned (like '-1'), the collection is unbounded.- Specified by:
getMaxOccurs
in interfaceChildElementCollection<T extends ModelElementInstance>
- Returns:
- the max element count for this collection.
-
getChildElementType
public ModelElementType getChildElementType(Model model)
Description copied from interface:ChildElementCollection
Get the model element type of the elements contained in this collection.- Specified by:
getChildElementType
in interfaceChildElementCollection<T extends ModelElementInstance>
- Parameters:
model
- the model of the element- Returns:
- the containing
ModelElementType
-
getChildElementTypeClass
public java.lang.Class<T> getChildElementTypeClass()
Description copied from interface:ChildElementCollection
Get the class of the elements contained in this collection.- Specified by:
getChildElementTypeClass
in interfaceChildElementCollection<T extends ModelElementInstance>
- Returns:
- the class of contained types
-
getParentElementType
public ModelElementType getParentElementType()
Description copied from interface:ChildElementCollection
Get the model element type of the element owns the collection- Specified by:
getParentElementType
in interfaceChildElementCollection<T extends ModelElementInstance>
- Returns:
- the parent element of the collection
-
setMaxOccurs
public void setMaxOccurs(int maxOccurs)
-
get
public java.util.Collection<T> get(ModelElementInstance element)
Description copied from interface:ChildElementCollection
returns aCollection
containing all or a subset of the child elements of aModelElementInstance
.- Specified by:
get
in interfaceChildElementCollection<T extends ModelElementInstance>
-
-