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>childElementTypeClassprotected intmaxOccursthe 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 aCollectioncontaining all or a subset of the child elements of aModelElementInstance.ModelElementTypegetChildElementType(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.intgetMaxOccurs()Indicates the max element count of a collection.intgetMinOccurs()Indicates the minimal element count of a collection.ModelElementTypegetParentElementType()Get the model element type of the element owns the collectionbooleanisImmutable()Indicates whether the collection is immutable.voidsetImmutable()voidsetMaxOccurs(int maxOccurs)voidsetMinOccurs(int minOccurs)voidsetMutable(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:ChildElementCollectionIndicates 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:
isImmutablein interfaceChildElementCollection<T extends ModelElementInstance>- Returns:
- true if the collection is mutable, false otherwise.
-
getMinOccurs
public int getMinOccurs()
Description copied from interface:ChildElementCollectionIndicates the minimal element count of a collection. Returns a positive integer or '0'.- Specified by:
getMinOccursin 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:ChildElementCollectionIndicates the max element count of a collection. In a negative value is returned (like '-1'), the collection is unbounded.- Specified by:
getMaxOccursin interfaceChildElementCollection<T extends ModelElementInstance>- Returns:
- the max element count for this collection.
-
getChildElementType
public ModelElementType getChildElementType(Model model)
Description copied from interface:ChildElementCollectionGet the model element type of the elements contained in this collection.- Specified by:
getChildElementTypein 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:ChildElementCollectionGet the class of the elements contained in this collection.- Specified by:
getChildElementTypeClassin interfaceChildElementCollection<T extends ModelElementInstance>- Returns:
- the class of contained types
-
getParentElementType
public ModelElementType getParentElementType()
Description copied from interface:ChildElementCollectionGet the model element type of the element owns the collection- Specified by:
getParentElementTypein 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:ChildElementCollectionreturns aCollectioncontaining all or a subset of the child elements of aModelElementInstance.- Specified by:
getin interfaceChildElementCollection<T extends ModelElementInstance>
-
-