Class DomElementImpl
java.lang.Object
org.camunda.bpm.model.xml.impl.instance.DomElementImpl
- All Implemented Interfaces:
DomElement
- Author:
- Sebastian Menski
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addCDataSection
(String data) Adds a CDATA section to this element.void
appendChild
(DomElement childDomElement) Appends the element to the child elements of this element.boolean
getAttribute
(String attributeName) Returns the attribute value for the namespace of this element.getAttribute
(String namespaceUri, String localName) Returns the attribute value for the given namespace.Returns all child elements of this element.getChildElementsByNameNs
(String namespaceUri, String elementName) Returns all child elements of this element with a specific namespace + namegetChildElementsByNameNs
(Set<String> namespaceUris, String elementName) Returns all child elements of this element with specific namespaces + name.getChildElementsByType
(ModelInstanceImpl modelInstance, Class<? extends ModelElementInstance> elementType) Returns all child elements of this element with a specific type.Returns the DOM document which contains this element.protected Element
Returns the local name of this element.Returns theModelElementInstance
which is associated with this element.Returns the namespace URI for this element.Returns the parent element of this element.Returns the prefix of this element.Returns the root element of the document which contains this element.Gets the text content of this element all its descendants.boolean
hasAttribute
(String localName) Checks if this element has a attribute under the namespace of this element.boolean
hasAttribute
(String namespaceUri, String localName) Checks if this element has a attribute with the given namespace.int
hashCode()
void
insertChildElementAfter
(DomElement elementToInsert, DomElement insertAfter) Inserts the new child element after another child element.lookupPrefix
(String namespaceUri) Returns the prefix of the namespace starting from this node upwards.registerNamespace
(String namespaceUri) Adds a new namespace with a generated prefix to this element.void
registerNamespace
(String prefix, String namespaceUri) Adds a new namespace with prefix to this element.void
removeAttribute
(String localName) Removes the attribute for the namespace of this element.void
removeAttribute
(String namespaceUri, String localName) Removes the attribute for the given namespace.boolean
removeChild
(DomElement childDomElement) Removes a child element of this element.void
replaceChild
(DomElement newChildDomElement, DomElement existingChildDomElement) Replaces a child element with a new element.void
setAttribute
(String localName, String value) Sets the attribute value for the namespace of this element.void
setAttribute
(String namespaceUri, String localName, String value) Sets the attribute value for the given namespace.void
setIdAttribute
(String localName, String value) Sets the value of a id attribute for the namespace of this element.void
setIdAttribute
(String namespaceUri, String localName, String value) Sets the value of a id attribute for the given namespace.void
setModelElementInstance
(ModelElementInstance modelElementInstance) Sets theModelElementInstance
which should be associated with this element.void
setTextContent
(String textContent) Sets the text content of this element.
-
Constructor Details
-
DomElementImpl
-
-
Method Details
-
getElement
-
getNamespaceURI
Description copied from interface:DomElement
Returns the namespace URI for this element.- Specified by:
getNamespaceURI
in interfaceDomElement
- Returns:
- the namespace URI
-
getLocalName
Description copied from interface:DomElement
Returns the local name of this element.- Specified by:
getLocalName
in interfaceDomElement
- Returns:
- the local name
-
getPrefix
Description copied from interface:DomElement
Returns the prefix of this element.- Specified by:
getPrefix
in interfaceDomElement
- Returns:
- the prefix
-
getDocument
Description copied from interface:DomElement
Returns the DOM document which contains this element.- Specified by:
getDocument
in interfaceDomElement
- Returns:
- the DOM document or null if the element itself is a document
-
getRootElement
Description copied from interface:DomElement
Returns the root element of the document which contains this element.- Specified by:
getRootElement
in interfaceDomElement
- Returns:
- the root element of the document or null if non exists
-
getParentElement
Description copied from interface:DomElement
Returns the parent element of this element.- Specified by:
getParentElement
in interfaceDomElement
- Returns:
- the parent element or null if not part of a tree
-
getChildElements
Description copied from interface:DomElement
Returns all child elements of this element.- Specified by:
getChildElements
in interfaceDomElement
- Returns:
- the list of child elements
-
getChildElementsByNameNs
Description copied from interface:DomElement
Returns all child elements of this element with a specific namespace + name- Specified by:
getChildElementsByNameNs
in interfaceDomElement
- Returns:
- the list of child elements
-
getChildElementsByNameNs
Description copied from interface:DomElement
Returns all child elements of this element with specific namespaces + name.- Specified by:
getChildElementsByNameNs
in interfaceDomElement
- Returns:
- the list of child elements
-
getChildElementsByType
public List<DomElement> getChildElementsByType(ModelInstanceImpl modelInstance, Class<? extends ModelElementInstance> elementType) Description copied from interface:DomElement
Returns all child elements of this element with a specific type.- Specified by:
getChildElementsByType
in interfaceDomElement
- Returns:
- the list of child elements matching the type
-
replaceChild
Description copied from interface:DomElement
Replaces a child element with a new element.- Specified by:
replaceChild
in interfaceDomElement
- Parameters:
newChildDomElement
- the new child elementexistingChildDomElement
- the existing child element
-
removeChild
Description copied from interface:DomElement
Removes a child element of this element.- Specified by:
removeChild
in interfaceDomElement
- Parameters:
childDomElement
- the child element to remove- Returns:
- true if the child element was removed otherwise false
-
appendChild
Description copied from interface:DomElement
Appends the element to the child elements of this element.- Specified by:
appendChild
in interfaceDomElement
- Parameters:
childDomElement
- the element to append
-
insertChildElementAfter
Description copied from interface:DomElement
Inserts the new child element after another child element. If the child element to insert after is null the new child element will be inserted at the beginning.- Specified by:
insertChildElementAfter
in interfaceDomElement
- Parameters:
elementToInsert
- the new element to insertinsertAfter
- the existing child element to insert after or null
-
hasAttribute
Description copied from interface:DomElement
Checks if this element has a attribute under the namespace of this element.- Specified by:
hasAttribute
in interfaceDomElement
- Parameters:
localName
- the name of the attribute- Returns:
- true if the attribute exists otherwise false
-
hasAttribute
Description copied from interface:DomElement
Checks if this element has a attribute with the given namespace.- Specified by:
hasAttribute
in interfaceDomElement
- Parameters:
namespaceUri
- the namespaceUri of the namespacelocalName
- the name of the attribute- Returns:
- true if the attribute exists otherwise false
-
getAttribute
Description copied from interface:DomElement
Returns the attribute value for the namespace of this element.- Specified by:
getAttribute
in interfaceDomElement
- Parameters:
attributeName
- the name of the attribute- Returns:
- the value of the attribute or the empty string
-
getAttribute
Description copied from interface:DomElement
Returns the attribute value for the given namespace.- Specified by:
getAttribute
in interfaceDomElement
- Parameters:
namespaceUri
- the namespaceUri of the namespacelocalName
- the name of the attribute- Returns:
- the value of the attribute or the empty string
-
setAttribute
Description copied from interface:DomElement
Sets the attribute value for the namespace of this element.- Specified by:
setAttribute
in interfaceDomElement
- Parameters:
localName
- the name of the attributevalue
- the value to set
-
setAttribute
Description copied from interface:DomElement
Sets the attribute value for the given namespace.- Specified by:
setAttribute
in interfaceDomElement
- Parameters:
namespaceUri
- the namespaceUri of the namespacelocalName
- the name of the attributevalue
- the value to set
-
setIdAttribute
Description copied from interface:DomElement
Sets the value of a id attribute for the namespace of this element.- Specified by:
setIdAttribute
in interfaceDomElement
- Parameters:
localName
- the name of the attributevalue
- the value to set
-
setIdAttribute
Description copied from interface:DomElement
Sets the value of a id attribute for the given namespace.- Specified by:
setIdAttribute
in interfaceDomElement
- Parameters:
namespaceUri
- the namespaceUri of the namespacelocalName
- the name of the attributevalue
- the value to set
-
removeAttribute
Description copied from interface:DomElement
Removes the attribute for the namespace of this element.- Specified by:
removeAttribute
in interfaceDomElement
- Parameters:
localName
- the name of the attribute
-
removeAttribute
Description copied from interface:DomElement
Removes the attribute for the given namespace.- Specified by:
removeAttribute
in interfaceDomElement
- Parameters:
namespaceUri
- the namespaceUri of the namespacelocalName
- the name of the attribute
-
getTextContent
Description copied from interface:DomElement
Gets the text content of this element all its descendants.- Specified by:
getTextContent
in interfaceDomElement
- Returns:
- the text content
-
setTextContent
Description copied from interface:DomElement
Sets the text content of this element.- Specified by:
setTextContent
in interfaceDomElement
- Parameters:
textContent
- the text content to set
-
addCDataSection
Description copied from interface:DomElement
Adds a CDATA section to this element.- Specified by:
addCDataSection
in interfaceDomElement
-
getModelElementInstance
Description copied from interface:DomElement
Returns theModelElementInstance
which is associated with this element.- Specified by:
getModelElementInstance
in interfaceDomElement
- Returns:
- the
ModelElementInstance
or null if non is associated
-
setModelElementInstance
Description copied from interface:DomElement
Sets theModelElementInstance
which should be associated with this element.- Specified by:
setModelElementInstance
in interfaceDomElement
- Parameters:
modelElementInstance
- theModelElementInstance
to associate
-
registerNamespace
Description copied from interface:DomElement
Adds a new namespace with a generated prefix to this element.- Specified by:
registerNamespace
in interfaceDomElement
- Parameters:
namespaceUri
- the namespaceUri of the namespace- Returns:
- the generated prefix for the new namespace
-
registerNamespace
Description copied from interface:DomElement
Adds a new namespace with prefix to this element.- Specified by:
registerNamespace
in interfaceDomElement
- Parameters:
prefix
- the prefix of the namespacenamespaceUri
- the namespaceUri of the namespace
-
lookupPrefix
Description copied from interface:DomElement
Returns the prefix of the namespace starting from this node upwards. The default namespace has the prefixnull
.- Specified by:
lookupPrefix
in interfaceDomElement
- Parameters:
namespaceUri
- the namespaceUri of the namespace- Returns:
- the prefix or null if non is defined
-
equals
-
hashCode
public int hashCode()
-