public interface DomElement
Element
. Implementations of this interface must be thread-safe.Modifier and Type | Method and Description |
---|---|
void |
addCDataSection(String data)
Adds a CDATA section to this element.
|
void |
appendChild(DomElement childElement)
Appends the element to the child elements of this element.
|
String |
getAttribute(String attributeName)
Returns the attribute value for the namespace of this element.
|
String |
getAttribute(String namespaceUri,
String localName)
Returns the attribute value for the given namespace.
|
List<DomElement> |
getChildElements()
Returns all child elements of this element.
|
List<DomElement> |
getChildElementsByNameNs(Set<String> namespaceUris,
String elementName)
Returns all child elements of this element with specific namespaces + name.
|
List<DomElement> |
getChildElementsByNameNs(String namespaceUris,
String elementName)
Returns all child elements of this element with a specific namespace + name
|
List<DomElement> |
getChildElementsByType(ModelInstanceImpl modelInstance,
Class<? extends ModelElementInstance> elementType)
Returns all child elements of this element with a specific type.
|
DomDocument |
getDocument()
Returns the DOM document which contains this element.
|
String |
getLocalName()
Returns the local name of this element.
|
ModelElementInstance |
getModelElementInstance()
Returns the
ModelElementInstance which is associated with this element. |
String |
getNamespaceURI()
Returns the namespace URI for this element.
|
DomElement |
getParentElement()
Returns the parent element of this element.
|
String |
getPrefix()
Returns the prefix of this element.
|
DomElement |
getRootElement()
Returns the root element of the document which contains this element.
|
String |
getTextContent()
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.
|
void |
insertChildElementAfter(DomElement elementToInsert,
DomElement insertAfter)
Inserts the new child element after another child element.
|
String |
lookupPrefix(String namespaceUri)
Returns the prefix of the namespace starting from this node upwards.
|
String |
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 domElement)
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 the
ModelElementInstance which should be associated with this element. |
void |
setTextContent(String textContent)
Sets the text content of this element.
|
String getNamespaceURI()
String getLocalName()
String getPrefix()
DomDocument getDocument()
DomElement getRootElement()
DomElement getParentElement()
List<DomElement> getChildElements()
List<DomElement> getChildElementsByNameNs(String namespaceUris, String elementName)
List<DomElement> getChildElementsByNameNs(Set<String> namespaceUris, String elementName)
List<DomElement> getChildElementsByType(ModelInstanceImpl modelInstance, Class<? extends ModelElementInstance> elementType)
void replaceChild(DomElement newChildDomElement, DomElement existingChildDomElement)
newChildDomElement
- the new child elementexistingChildDomElement
- the existing child elementModelException
- if the child cannot be replacedboolean removeChild(DomElement domElement)
domElement
- the child element to removevoid appendChild(DomElement childElement)
childElement
- the element to appendvoid insertChildElementAfter(DomElement elementToInsert, DomElement insertAfter)
elementToInsert
- the new element to insertinsertAfter
- the existing child element to insert after or nullboolean hasAttribute(String localName)
localName
- the name of the attributeboolean hasAttribute(String namespaceUri, String localName)
namespaceUri
- the namespaceUri of the namespacelocalName
- the name of the attributeString getAttribute(String attributeName)
attributeName
- the name of the attributeString getAttribute(String namespaceUri, String localName)
namespaceUri
- the namespaceUri of the namespacelocalName
- the name of the attributevoid setAttribute(String localName, String value)
localName
- the name of the attributevalue
- the value to setvoid setAttribute(String namespaceUri, String localName, String value)
namespaceUri
- the namespaceUri of the namespacelocalName
- the name of the attributevalue
- the value to setvoid setIdAttribute(String localName, String value)
localName
- the name of the attributevalue
- the value to setvoid setIdAttribute(String namespaceUri, String localName, String value)
namespaceUri
- the namespaceUri of the namespacelocalName
- the name of the attributevalue
- the value to setvoid removeAttribute(String localName)
localName
- the name of the attributevoid removeAttribute(String namespaceUri, String localName)
namespaceUri
- the namespaceUri of the namespacelocalName
- the name of the attributeString getTextContent()
void setTextContent(String textContent)
textContent
- the text content to setvoid addCDataSection(String data)
textContent
- the CDATA content to setModelElementInstance getModelElementInstance()
ModelElementInstance
which is associated with this element.ModelElementInstance
or null if non is associatedvoid setModelElementInstance(ModelElementInstance modelElementInstance)
ModelElementInstance
which should be associated with this element.modelElementInstance
- the ModelElementInstance
to associateString registerNamespace(String namespaceUri)
namespaceUri
- the namespaceUri of the namespacevoid registerNamespace(String prefix, String namespaceUri)
prefix
- the prefix of the namespacenamespaceUri
- the namespaceUri of the namespaceCopyright © 2017. All rights reserved.