Interface DomElement
- 
- All Known Implementing Classes:
- DomElementImpl
 
 public interface DomElementEncapsulatesElement. Implementations of this interface must be thread-safe.- Author:
- Sebastian Menski
 
- 
- 
Method SummaryAll Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddCDataSection(java.lang.String data)Adds a CDATA section to this element.voidappendChild(DomElement childElement)Appends the element to the child elements of this element.java.lang.StringgetAttribute(java.lang.String attributeName)Returns the attribute value for the namespace of this element.java.lang.StringgetAttribute(java.lang.String namespaceUri, java.lang.String localName)Returns the attribute value for the given namespace.java.util.List<DomElement>getChildElements()Returns all child elements of this element.java.util.List<DomElement>getChildElementsByNameNs(java.lang.String namespaceUris, java.lang.String elementName)Returns all child elements of this element with a specific namespace + namejava.util.List<DomElement>getChildElementsByNameNs(java.util.Set<java.lang.String> namespaceUris, java.lang.String elementName)Returns all child elements of this element with specific namespaces + name.java.util.List<DomElement>getChildElementsByType(ModelInstanceImpl modelInstance, java.lang.Class<? extends ModelElementInstance> elementType)Returns all child elements of this element with a specific type.DomDocumentgetDocument()Returns the DOM document which contains this element.java.lang.StringgetLocalName()Returns the local name of this element.ModelElementInstancegetModelElementInstance()Returns theModelElementInstancewhich is associated with this element.java.lang.StringgetNamespaceURI()Returns the namespace URI for this element.DomElementgetParentElement()Returns the parent element of this element.java.lang.StringgetPrefix()Returns the prefix of this element.DomElementgetRootElement()Returns the root element of the document which contains this element.java.lang.StringgetTextContent()Gets the text content of this element all its descendants.booleanhasAttribute(java.lang.String localName)Checks if this element has a attribute under the namespace of this element.booleanhasAttribute(java.lang.String namespaceUri, java.lang.String localName)Checks if this element has a attribute with the given namespace.voidinsertChildElementAfter(DomElement elementToInsert, DomElement insertAfter)Inserts the new child element after another child element.java.lang.StringlookupPrefix(java.lang.String namespaceUri)Returns the prefix of the namespace starting from this node upwards.java.lang.StringregisterNamespace(java.lang.String namespaceUri)Adds a new namespace with a generated prefix to this element.voidregisterNamespace(java.lang.String prefix, java.lang.String namespaceUri)Adds a new namespace with prefix to this element.voidremoveAttribute(java.lang.String localName)Removes the attribute for the namespace of this element.voidremoveAttribute(java.lang.String namespaceUri, java.lang.String localName)Removes the attribute for the given namespace.booleanremoveChild(DomElement domElement)Removes a child element of this element.voidreplaceChild(DomElement newChildDomElement, DomElement existingChildDomElement)Replaces a child element with a new element.voidsetAttribute(java.lang.String localName, java.lang.String value)Sets the attribute value for the namespace of this element.voidsetAttribute(java.lang.String namespaceUri, java.lang.String localName, java.lang.String value)Sets the attribute value for the given namespace.voidsetIdAttribute(java.lang.String localName, java.lang.String value)Sets the value of a id attribute for the namespace of this element.voidsetIdAttribute(java.lang.String namespaceUri, java.lang.String localName, java.lang.String value)Sets the value of a id attribute for the given namespace.voidsetModelElementInstance(ModelElementInstance modelElementInstance)Sets theModelElementInstancewhich should be associated with this element.voidsetTextContent(java.lang.String textContent)Sets the text content of this element.
 
- 
- 
- 
Method Detail- 
getNamespaceURIjava.lang.String getNamespaceURI() Returns the namespace URI for this element.- Returns:
- the namespace URI
 
 - 
getLocalNamejava.lang.String getLocalName() Returns the local name of this element.- Returns:
- the local name
 
 - 
getPrefixjava.lang.String getPrefix() Returns the prefix of this element.- Returns:
- the prefix
 
 - 
getDocumentDomDocument getDocument() Returns the DOM document which contains this element.- Returns:
- the DOM document or null if the element itself is a document
 
 - 
getRootElementDomElement getRootElement() Returns the root element of the document which contains this element.- Returns:
- the root element of the document or null if non exists
 
 - 
getParentElementDomElement getParentElement() Returns the parent element of this element.- Returns:
- the parent element or null if not part of a tree
 
 - 
getChildElementsjava.util.List<DomElement> getChildElements() Returns all child elements of this element.- Returns:
- the list of child elements
 
 - 
getChildElementsByNameNsjava.util.List<DomElement> getChildElementsByNameNs(java.lang.String namespaceUris, java.lang.String elementName) Returns all child elements of this element with a specific namespace + name- Returns:
- the list of child elements
 
 - 
getChildElementsByNameNsjava.util.List<DomElement> getChildElementsByNameNs(java.util.Set<java.lang.String> namespaceUris, java.lang.String elementName) Returns all child elements of this element with specific namespaces + name.- Returns:
- the list of child elements
 
 - 
getChildElementsByTypejava.util.List<DomElement> getChildElementsByType(ModelInstanceImpl modelInstance, java.lang.Class<? extends ModelElementInstance> elementType) Returns all child elements of this element with a specific type.- Returns:
- the list of child elements matching the type
 
 - 
replaceChildvoid replaceChild(DomElement newChildDomElement, DomElement existingChildDomElement) Replaces a child element with a new element.- Parameters:
- newChildDomElement- the new child element
- existingChildDomElement- the existing child element
- Throws:
- ModelException- if the child cannot be replaced
 
 - 
removeChildboolean removeChild(DomElement domElement) Removes a child element of this element.- Parameters:
- domElement- the child element to remove
- Returns:
- true if the child element was removed otherwise false
 
 - 
appendChildvoid appendChild(DomElement childElement) Appends the element to the child elements of this element.- Parameters:
- childElement- the element to append
 
 - 
insertChildElementAftervoid insertChildElementAfter(DomElement elementToInsert, DomElement insertAfter) 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.- Parameters:
- elementToInsert- the new element to insert
- insertAfter- the existing child element to insert after or null
 
 - 
hasAttributeboolean hasAttribute(java.lang.String localName) Checks if this element has a attribute under the namespace of this element.- Parameters:
- localName- the name of the attribute
- Returns:
- true if the attribute exists otherwise false
 
 - 
hasAttributeboolean hasAttribute(java.lang.String namespaceUri, java.lang.String localName)Checks if this element has a attribute with the given namespace.- Parameters:
- namespaceUri- the namespaceUri of the namespace
- localName- the name of the attribute
- Returns:
- true if the attribute exists otherwise false
 
 - 
getAttributejava.lang.String getAttribute(java.lang.String attributeName) Returns the attribute value for the namespace of this element.- Parameters:
- attributeName- the name of the attribute
- Returns:
- the value of the attribute or the empty string
 
 - 
getAttributejava.lang.String getAttribute(java.lang.String namespaceUri, java.lang.String localName)Returns the attribute value for the given namespace.- Parameters:
- namespaceUri- the namespaceUri of the namespace
- localName- the name of the attribute
- Returns:
- the value of the attribute or the empty string
 
 - 
setAttributevoid setAttribute(java.lang.String localName, java.lang.String value)Sets the attribute value for the namespace of this element.- Parameters:
- localName- the name of the attribute
- value- the value to set
 
 - 
setAttributevoid setAttribute(java.lang.String namespaceUri, java.lang.String localName, java.lang.String value)Sets the attribute value for the given namespace.- Parameters:
- namespaceUri- the namespaceUri of the namespace
- localName- the name of the attribute
- value- the value to set
 
 - 
setIdAttributevoid setIdAttribute(java.lang.String localName, java.lang.String value)Sets the value of a id attribute for the namespace of this element.- Parameters:
- localName- the name of the attribute
- value- the value to set
 
 - 
setIdAttributevoid setIdAttribute(java.lang.String namespaceUri, java.lang.String localName, java.lang.String value)Sets the value of a id attribute for the given namespace.- Parameters:
- namespaceUri- the namespaceUri of the namespace
- localName- the name of the attribute
- value- the value to set
 
 - 
removeAttributevoid removeAttribute(java.lang.String localName) Removes the attribute for the namespace of this element.- Parameters:
- localName- the name of the attribute
 
 - 
removeAttributevoid removeAttribute(java.lang.String namespaceUri, java.lang.String localName)Removes the attribute for the given namespace.- Parameters:
- namespaceUri- the namespaceUri of the namespace
- localName- the name of the attribute
 
 - 
getTextContentjava.lang.String getTextContent() Gets the text content of this element all its descendants.- Returns:
- the text content
 
 - 
setTextContentvoid setTextContent(java.lang.String textContent) Sets the text content of this element.- Parameters:
- textContent- the text content to set
 
 - 
addCDataSectionvoid addCDataSection(java.lang.String data) Adds a CDATA section to this element.- Parameters:
- textContent- the CDATA content to set
 
 - 
getModelElementInstanceModelElementInstance getModelElementInstance() Returns theModelElementInstancewhich is associated with this element.- Returns:
- the ModelElementInstanceor null if non is associated
 
 - 
setModelElementInstancevoid setModelElementInstance(ModelElementInstance modelElementInstance) Sets theModelElementInstancewhich should be associated with this element.- Parameters:
- modelElementInstance- the- ModelElementInstanceto associate
 
 - 
registerNamespacejava.lang.String registerNamespace(java.lang.String namespaceUri) Adds a new namespace with a generated prefix to this element.- Parameters:
- namespaceUri- the namespaceUri of the namespace
- Returns:
- the generated prefix for the new namespace
 
 - 
registerNamespacevoid registerNamespace(java.lang.String prefix, java.lang.String namespaceUri)Adds a new namespace with prefix to this element.- Parameters:
- prefix- the prefix of the namespace
- namespaceUri- the namespaceUri of the namespace
 
 - 
lookupPrefixjava.lang.String lookupPrefix(java.lang.String namespaceUri) Returns the prefix of the namespace starting from this node upwards. The default namespace has the prefixnull.- Parameters:
- namespaceUri- the namespaceUri of the namespace
- Returns:
- the prefix or null if non is defined
 
 
- 
 
-