public class DomElementImpl extends Object implements DomElement
| Constructor and Description |
|---|
DomElementImpl(Element element) |
| Modifier and Type | Method and Description |
|---|---|
void |
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 |
equals(Object o) |
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 namespaceUri,
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.
|
protected Element |
getElement() |
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.
|
int |
hashCode() |
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 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 the
ModelElementInstance which should be associated with this element. |
void |
setTextContent(String textContent)
Sets the text content of this element.
|
public DomElementImpl(Element element)
protected Element getElement()
public String getNamespaceURI()
DomElementgetNamespaceURI in interface DomElementpublic String getLocalName()
DomElementgetLocalName in interface DomElementpublic String getPrefix()
DomElementgetPrefix in interface DomElementpublic DomDocument getDocument()
DomElementgetDocument in interface DomElementpublic DomElement getRootElement()
DomElementgetRootElement in interface DomElementpublic DomElement getParentElement()
DomElementgetParentElement in interface DomElementpublic List<DomElement> getChildElements()
DomElementgetChildElements in interface DomElementpublic List<DomElement> getChildElementsByNameNs(String namespaceUri, String elementName)
DomElementgetChildElementsByNameNs in interface DomElementpublic List<DomElement> getChildElementsByNameNs(Set<String> namespaceUris, String elementName)
DomElementgetChildElementsByNameNs in interface DomElementpublic List<DomElement> getChildElementsByType(ModelInstanceImpl modelInstance, Class<? extends ModelElementInstance> elementType)
DomElementgetChildElementsByType in interface DomElementpublic void replaceChild(DomElement newChildDomElement, DomElement existingChildDomElement)
DomElementreplaceChild in interface DomElementnewChildDomElement - the new child elementexistingChildDomElement - the existing child elementpublic boolean removeChild(DomElement childDomElement)
DomElementremoveChild in interface DomElementchildDomElement - the child element to removepublic void appendChild(DomElement childDomElement)
DomElementappendChild in interface DomElementchildDomElement - the element to appendpublic void insertChildElementAfter(DomElement elementToInsert, DomElement insertAfter)
DomElementinsertChildElementAfter in interface DomElementelementToInsert - the new element to insertinsertAfter - the existing child element to insert after or nullpublic boolean hasAttribute(String localName)
DomElementhasAttribute in interface DomElementlocalName - the name of the attributepublic boolean hasAttribute(String namespaceUri, String localName)
DomElementhasAttribute in interface DomElementnamespaceUri - the namespaceUri of the namespacelocalName - the name of the attributepublic String getAttribute(String attributeName)
DomElementgetAttribute in interface DomElementattributeName - the name of the attributepublic String getAttribute(String namespaceUri, String localName)
DomElementgetAttribute in interface DomElementnamespaceUri - the namespaceUri of the namespacelocalName - the name of the attributepublic void setAttribute(String localName, String value)
DomElementsetAttribute in interface DomElementlocalName - the name of the attributevalue - the value to setpublic void setAttribute(String namespaceUri, String localName, String value)
DomElementsetAttribute in interface DomElementnamespaceUri - the namespaceUri of the namespacelocalName - the name of the attributevalue - the value to setpublic void setIdAttribute(String localName, String value)
DomElementsetIdAttribute in interface DomElementlocalName - the name of the attributevalue - the value to setpublic void setIdAttribute(String namespaceUri, String localName, String value)
DomElementsetIdAttribute in interface DomElementnamespaceUri - the namespaceUri of the namespacelocalName - the name of the attributevalue - the value to setpublic void removeAttribute(String localName)
DomElementremoveAttribute in interface DomElementlocalName - the name of the attributepublic void removeAttribute(String namespaceUri, String localName)
DomElementremoveAttribute in interface DomElementnamespaceUri - the namespaceUri of the namespacelocalName - the name of the attributepublic String getTextContent()
DomElementgetTextContent in interface DomElementpublic void setTextContent(String textContent)
DomElementsetTextContent in interface DomElementtextContent - the text content to setpublic void addCDataSection(String data)
DomElementaddCDataSection in interface DomElementpublic ModelElementInstance getModelElementInstance()
DomElementModelElementInstance which is associated with this element.getModelElementInstance in interface DomElementModelElementInstance or null if non is associatedpublic void setModelElementInstance(ModelElementInstance modelElementInstance)
DomElementModelElementInstance which should be associated with this element.setModelElementInstance in interface DomElementmodelElementInstance - the ModelElementInstance to associatepublic String registerNamespace(String namespaceUri)
DomElementregisterNamespace in interface DomElementnamespaceUri - the namespaceUri of the namespacepublic void registerNamespace(String prefix, String namespaceUri)
DomElementregisterNamespace in interface DomElementprefix - the prefix of the namespacenamespaceUri - the namespaceUri of the namespacepublic String lookupPrefix(String namespaceUri)
DomElementnull.lookupPrefix in interface DomElementnamespaceUri - the namespaceUri of the namespaceCopyright © 2022. All rights reserved.