|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.camunda.bpm.model.xml.impl.instance.ModelElementInstanceImpl
public class ModelElementInstanceImpl
Base class for implementing Model Elements.
| Field Summary | |
|---|---|
protected ModelInstanceImpl |
modelInstance
the containing model instance |
| Constructor Summary | |
|---|---|
ModelElementInstanceImpl(ModelTypeInstanceContext instanceContext)
|
|
| Method Summary | ||
|---|---|---|
void |
addChildElement(ModelElementInstance newChild)
Adds a new child element to the children of this element. |
|
boolean |
equals(Object obj)
|
|
String |
getAttributeValue(String attributeName)
Returns the attribute value for the attribute name. |
|
String |
getAttributeValueNs(String namespaceUri,
String attributeName)
Returns the attribute value for the given attribute name and namespace URI. |
|
|
getChildElementsByType(Class<T> childElementClass)
Return all child elements of a given type |
|
Collection<ModelElementInstance> |
getChildElementsByType(ModelElementType childElementType)
Return all child elements of a given type |
|
DomElement |
getDomElement()
Returns the represented DOM DomElement. |
|
ModelElementType |
getElementType()
Returns the element type of this. |
|
ModelInstanceImpl |
getModelInstance()
Returns the model instance which contains this type instance. |
|
ModelElementInstance |
getParentElement()
Returns the parent element of this. |
|
String |
getRawTextContent()
Returns the raw text content of the DOM element including all whitespaces. |
|
String |
getTextContent()
Returns the text content of the DOM element without leading and trailing spaces. |
|
ModelElementInstance |
getUniqueChildElementByNameNs(String namespaceUri,
String elementName)
Returns a child element with the given name or 'null' if no such element exists |
|
ModelElementInstance |
getUniqueChildElementByType(Class<? extends ModelElementInstance> elementType)
Returns a child element with the given type |
|
int |
hashCode()
|
|
void |
insertElementAfter(ModelElementInstance elementToInsert,
ModelElementInstance insertAfterElement)
Inserts the new element after the given element or at the beginning if the given element is null. |
|
static void |
registerType(ModelBuilder modelBuilder)
|
|
void |
removeAttribute(String attributeName)
Removes attribute by name. |
|
void |
removeAttributeNs(String namespaceUri,
String attributeName)
Removes the attribute by name and namespace. |
|
boolean |
removeChildElement(ModelElementInstance child)
Removes the child element from this. |
|
void |
replaceChildElement(ModelElementInstance existingChild,
ModelElementInstance newChild)
Replace an existing child element with a new child element. |
|
void |
replaceWithElement(ModelElementInstance newElement)
Replaces this element with a new element and updates references. |
|
void |
setAttributeValue(String attributeName,
String xmlValue)
Sets the value by name of a non-ID attribute. |
|
void |
setAttributeValue(String attributeName,
String xmlValue,
boolean isIdAttribute)
Sets attribute value by name. |
|
void |
setAttributeValueNs(String namespaceUri,
String attributeName,
String xmlValue)
Sets the value by name and namespace of a non-ID attribute. |
|
void |
setAttributeValueNs(String namespaceUri,
String attributeName,
String xmlValue,
boolean isIdAttribute)
Sets the attribute value by name and namespace. |
|
void |
setTextContent(String textContent)
Sets the text content of the DOM element |
|
void |
setUniqueChildElementByNameNs(ModelElementInstance newChild)
Adds or replaces a child element by name. |
|
void |
updateAfterReplacement()
Execute updates after the element was inserted as a replacement of another element. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final ModelInstanceImpl modelInstance
| Constructor Detail |
|---|
public ModelElementInstanceImpl(ModelTypeInstanceContext instanceContext)
| Method Detail |
|---|
public static void registerType(ModelBuilder modelBuilder)
public DomElement getDomElement()
ModelElementInstanceDomElement.
getDomElement in interface ModelElementInstancepublic ModelInstanceImpl getModelInstance()
ModelElementInstance
getModelInstance in interface ModelElementInstancepublic ModelElementInstance getParentElement()
ModelElementInstance
getParentElement in interface ModelElementInstancepublic ModelElementType getElementType()
ModelElementInstance
getElementType in interface ModelElementInstancepublic String getAttributeValue(String attributeName)
ModelElementInstance
getAttributeValue in interface ModelElementInstanceattributeName - the name of the attribute
public String getAttributeValueNs(String namespaceUri,
String attributeName)
ModelElementInstance
getAttributeValueNs in interface ModelElementInstancenamespaceUri - the namespace URI of the attributeattributeName - the attribute name of the attribute
public void setAttributeValue(String attributeName,
String xmlValue)
ModelElementInstance
setAttributeValue in interface ModelElementInstanceattributeName - the name of the attributexmlValue - the value to set
public void setAttributeValue(String attributeName,
String xmlValue,
boolean isIdAttribute)
ModelElementInstance
setAttributeValue in interface ModelElementInstanceattributeName - the name of the attributexmlValue - the value to setisIdAttribute - true if the attribute is an ID attribute, false otherwise
public void setAttributeValueNs(String namespaceUri,
String attributeName,
String xmlValue)
ModelElementInstance
setAttributeValueNs in interface ModelElementInstancenamespaceUri - the namespace URI of the attributeattributeName - the name of the attributexmlValue - the XML value to set
public void setAttributeValueNs(String namespaceUri,
String attributeName,
String xmlValue,
boolean isIdAttribute)
ModelElementInstance
setAttributeValueNs in interface ModelElementInstancenamespaceUri - the namespace URI of the attributeattributeName - the name of the attributexmlValue - the XML value to setisIdAttribute - true if the attribute is an ID attribute, false otherwisepublic void removeAttribute(String attributeName)
ModelElementInstance
removeAttribute in interface ModelElementInstanceattributeName - the name of the attribute
public void removeAttributeNs(String namespaceUri,
String attributeName)
ModelElementInstance
removeAttributeNs in interface ModelElementInstancenamespaceUri - the namespace URI of the attributeattributeName - the name of the attributepublic String getTextContent()
ModelElementInstancegetRawTextContent().
getTextContent in interface ModelElementInstancepublic void setTextContent(String textContent)
ModelElementInstance
setTextContent in interface ModelElementInstancetextContent - the new text contentpublic String getRawTextContent()
ModelElementInstance
getRawTextContent in interface ModelElementInstance
public ModelElementInstance getUniqueChildElementByNameNs(String namespaceUri,
String elementName)
ModelElementInstance
getUniqueChildElementByNameNs in interface ModelElementInstancenamespaceUri - the local name of the elementelementName - the namespace of the element
public ModelElementInstance getUniqueChildElementByType(Class<? extends ModelElementInstance> elementType)
ModelElementInstance
getUniqueChildElementByType in interface ModelElementInstanceelementType - the type of the element
public void setUniqueChildElementByNameNs(ModelElementInstance newChild)
ModelElementInstance
setUniqueChildElementByNameNs in interface ModelElementInstancenewChild - the child to add
public void replaceChildElement(ModelElementInstance existingChild,
ModelElementInstance newChild)
ModelElementInstance
replaceChildElement in interface ModelElementInstanceexistingChild - the child element to replacenewChild - the new child elementpublic void replaceWithElement(ModelElementInstance newElement)
ModelElementInstance
replaceWithElement in interface ModelElementInstancenewElement - the new element to replace withpublic void addChildElement(ModelElementInstance newChild)
ModelElementInstance
addChildElement in interface ModelElementInstancenewChild - the new child elementpublic boolean removeChildElement(ModelElementInstance child)
ModelElementInstance
removeChildElement in interface ModelElementInstancechild - the child element to remove
public Collection<ModelElementInstance> getChildElementsByType(ModelElementType childElementType)
ModelElementInstance
getChildElementsByType in interface ModelElementInstancechildElementType - the child element type to search for
public <T extends ModelElementInstance> Collection<T> getChildElementsByType(Class<T> childElementClass)
ModelElementInstance
getChildElementsByType in interface ModelElementInstancechildElementClass - the class of the child element type to search for
public void insertElementAfter(ModelElementInstance elementToInsert,
ModelElementInstance insertAfterElement)
ModelElementInstance
insertElementAfter in interface ModelElementInstanceelementToInsert - the new element to insertinsertAfterElement - the element to insert after or null to insert at first positionpublic void updateAfterReplacement()
ModelElementInstance
updateAfterReplacement in interface ModelElementInstancepublic int hashCode()
hashCode in class Objectpublic boolean equals(Object obj)
equals in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||