Package org.dom4j.dom
Class DOMElement
- 
public class DOMElement extends DefaultElement implements Element
DOMElementimplements an XML element which supports the W3C DOM API.- See Also:
 - Serialized Form
 
 
- 
- 
Field Summary
- 
Fields inherited from class org.dom4j.tree.AbstractElement
USE_STRINGVALUE_SEPARATOR, VERBOSE_TOSTRING 
- 
Fields inherited from class org.dom4j.tree.AbstractBranch
DEFAULT_CONTENT_LIST_SIZE 
- 
Fields inherited from class org.dom4j.tree.AbstractNode
NODE_TYPE_NAMES 
- 
Fields inherited from interface org.dom4j.Node
ANY_NODE, ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_NODE, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_REFERENCE_NODE, MAX_NODE_TYPE, NAMESPACE_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE, UNKNOWN_NODE 
- 
Fields inherited from interface org.w3c.dom.Node
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_POSITION_CONTAINED_BY, DOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_DISCONNECTED, DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, DOCUMENT_POSITION_PRECEDING, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE 
 - 
 
- 
Constructor Summary
Constructors Constructor Description DOMElement(String name)DOMElement(String name, Namespace namespace)DOMElement(QName qname)DOMElement(QName qname, int attributeCount) 
- 
Method Summary
- 
Methods inherited from class org.dom4j.tree.DefaultElement
add, additionalNamespaces, additionalNamespaces, addNewNode, attribute, attribute, attribute, attribute, attributeCount, attributeIterator, attributeList, attributeList, attributes, clearContent, clone, contentList, declaredNamespaces, element, element, element, getDocument, getNamespaceForPrefix, getNamespaceForURI, getParent, getQName, getStringValue, getText, indexOf, node, nodeCount, nodeIterator, processingInstruction, processingInstructions, processingInstructions, remove, removeNode, removeProcessingInstruction, setAttributeList, setAttributes, setContent, setDocument, setParent, setQName, supportsParent 
- 
Methods inherited from class org.dom4j.tree.AbstractElement
accept, add, add, add, add, add, add, add, add, addAttribute, addAttribute, addCDATA, addComment, addElement, addEntity, addNamespace, addNewNode, addNode, addNode, addProcessingInstruction, addProcessingInstruction, addText, appendAttributes, asXML, attributeValue, attributeValue, attributeValue, attributeValue, childAdded, childRemoved, createAttributeList, createAttributeList, createCopy, createCopy, createCopy, createElement, createElement, createSingleIterator, elementIterator, elementIterator, elementIterator, elementIterator, elements, elements, elements, elements, elementText, elementText, elementTextTrim, elementTextTrim, ensureAttributesCapacity, getData, getName, getNamespace, getNamespacePrefix, getNamespacesForURI, getNodeType, getPath, getQName, getQualifiedName, getUniquePath, getXPathNameStep, getXPathResult, hasMixedContent, isRootElement, isTextOnly, normalize, remove, remove, remove, remove, remove, remove, remove, remove, setAttributes, setAttributeValue, setAttributeValue, setData, setName, setNamespace, setText, toString, write 
- 
Methods inherited from class org.dom4j.tree.AbstractBranch
addElement, addElement, addElement, appendContent, content, contentRemoved, createContentList, createContentList, createEmptyList, createResultList, createSingleResultList, elementByID, elementID, getContentAsStringValue, getContentAsText, getTextTrim, hasContent, invalidNodeTypeAddException, isReadOnly, setProcessingInstructions 
- 
Methods inherited from class org.dom4j.tree.AbstractNode
asXPathResult, createPattern, createXPath, createXPathFilter, createXPathResult, detach, getNodeTypeName, getPath, getUniquePath, matches, numberValueOf, selectNodes, selectNodes, selectNodes, selectObject, selectSingleNode, valueOf 
- 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait 
- 
Methods inherited from interface org.dom4j.Branch
addElement, addElement, appendContent, content, elementByID, setProcessingInstructions 
- 
Methods inherited from interface org.dom4j.Element
getTextTrim 
- 
Methods inherited from interface org.dom4j.Node
asXPathResult, createXPath, detach, getNodeTypeName, getPath, getUniquePath, hasContent, isReadOnly, matches, numberValueOf, selectNodes, selectNodes, selectNodes, selectObject, selectSingleNode, valueOf 
- 
Methods inherited from interface org.w3c.dom.Node
getNodeType, normalize 
 - 
 
 - 
 
- 
- 
Method Detail
- 
getNamespaceURI
public String getNamespaceURI()
Description copied from interface:ElementReturns the URI mapped to the namespace of this element if one exists otherwise an emptyStringis returned.- Specified by:
 getNamespaceURIin interfaceElement- Specified by:
 getNamespaceURIin interfaceNode- Overrides:
 getNamespaceURIin classAbstractElement- Returns:
 - the URI for the 
Namespaceof this element or an emptyString 
 
- 
setPrefix
public void setPrefix(String prefix) throws DOMException
- Specified by:
 setPrefixin interfaceNode- Throws:
 DOMException
 
- 
getLocalName
public String getLocalName()
- Specified by:
 getLocalNamein interfaceNode
 
- 
getNodeName
public String getNodeName()
- Specified by:
 getNodeNamein interfaceNode
 
- 
getNodeValue
public String getNodeValue() throws DOMException
- Specified by:
 getNodeValuein interfaceNode- Throws:
 DOMException
 
- 
setNodeValue
public void setNodeValue(String nodeValue) throws DOMException
- Specified by:
 setNodeValuein interfaceNode- Throws:
 DOMException
 
- 
getParentNode
public Node getParentNode()
- Specified by:
 getParentNodein interfaceNode
 
- 
getChildNodes
public NodeList getChildNodes()
- Specified by:
 getChildNodesin interfaceNode
 
- 
getFirstChild
public Node getFirstChild()
- Specified by:
 getFirstChildin interfaceNode
 
- 
getLastChild
public Node getLastChild()
- Specified by:
 getLastChildin interfaceNode
 
- 
getPreviousSibling
public Node getPreviousSibling()
- Specified by:
 getPreviousSiblingin interfaceNode
 
- 
getNextSibling
public Node getNextSibling()
- Specified by:
 getNextSiblingin interfaceNode
 
- 
getAttributes
public NamedNodeMap getAttributes()
- Specified by:
 getAttributesin interfaceNode
 
- 
getOwnerDocument
public Document getOwnerDocument()
- Specified by:
 getOwnerDocumentin interfaceNode
 
- 
insertBefore
public Node insertBefore(Node newChild, Node refChild) throws DOMException
- Specified by:
 insertBeforein interfaceNode- Throws:
 DOMException
 
- 
replaceChild
public Node replaceChild(Node newChild, Node oldChild) throws DOMException
- Specified by:
 replaceChildin interfaceNode- Throws:
 DOMException
 
- 
removeChild
public Node removeChild(Node oldChild) throws DOMException
- Specified by:
 removeChildin interfaceNode- Throws:
 DOMException
 
- 
appendChild
public Node appendChild(Node newChild) throws DOMException
- Specified by:
 appendChildin interfaceNode- Throws:
 DOMException
 
- 
hasChildNodes
public boolean hasChildNodes()
- Specified by:
 hasChildNodesin interfaceNode
 
- 
isSupported
public boolean isSupported(String feature, String version)
- Specified by:
 isSupportedin interfaceNode
 
- 
hasAttributes
public boolean hasAttributes()
- Specified by:
 hasAttributesin interfaceNode
 
- 
getTagName
public String getTagName()
- Specified by:
 getTagNamein interfaceElement
 
- 
getAttribute
public String getAttribute(String name)
- Specified by:
 getAttributein interfaceElement
 
- 
setAttribute
public void setAttribute(String name, String value) throws DOMException
- Specified by:
 setAttributein interfaceElement- Throws:
 DOMException
 
- 
removeAttribute
public void removeAttribute(String name) throws DOMException
- Specified by:
 removeAttributein interfaceElement- Throws:
 DOMException
 
- 
getAttributeNode
public Attr getAttributeNode(String name)
- Specified by:
 getAttributeNodein interfaceElement
 
- 
setAttributeNode
public Attr setAttributeNode(Attr newAttr) throws DOMException
- Specified by:
 setAttributeNodein interfaceElement- Throws:
 DOMException
 
- 
removeAttributeNode
public Attr removeAttributeNode(Attr oldAttr) throws DOMException
- Specified by:
 removeAttributeNodein interfaceElement- Throws:
 DOMException
 
- 
getAttributeNS
public String getAttributeNS(String namespaceURI, String localName)
- Specified by:
 getAttributeNSin interfaceElement
 
- 
setAttributeNS
public void setAttributeNS(String namespaceURI, String qualifiedName, String value) throws DOMException
- Specified by:
 setAttributeNSin interfaceElement- Throws:
 DOMException
 
- 
removeAttributeNS
public void removeAttributeNS(String namespaceURI, String localName) throws DOMException
- Specified by:
 removeAttributeNSin interfaceElement- Throws:
 DOMException
 
- 
getAttributeNodeNS
public Attr getAttributeNodeNS(String namespaceURI, String localName)
- Specified by:
 getAttributeNodeNSin interfaceElement
 
- 
setAttributeNodeNS
public Attr setAttributeNodeNS(Attr newAttr) throws DOMException
- Specified by:
 setAttributeNodeNSin interfaceElement- Throws:
 DOMException
 
- 
getElementsByTagName
public NodeList getElementsByTagName(String name)
- Specified by:
 getElementsByTagNamein interfaceElement
 
- 
getElementsByTagNameNS
public NodeList getElementsByTagNameNS(String namespace, String lName)
- Specified by:
 getElementsByTagNameNSin interfaceElement
 
- 
hasAttribute
public boolean hasAttribute(String name)
- Specified by:
 hasAttributein interfaceElement
 
- 
hasAttributeNS
public boolean hasAttributeNS(String namespaceURI, String localName)
- Specified by:
 hasAttributeNSin interfaceElement
 
- 
getDocumentFactory
protected DocumentFactory getDocumentFactory()
- Overrides:
 getDocumentFactoryin classDefaultElement
 
- 
getSchemaTypeInfo
public TypeInfo getSchemaTypeInfo()
- Specified by:
 getSchemaTypeInfoin interfaceElement
 
- 
setIdAttribute
public void setIdAttribute(String name, boolean isId) throws DOMException
- Specified by:
 setIdAttributein interfaceElement- Throws:
 DOMException
 
- 
setIdAttributeNS
public void setIdAttributeNS(String namespaceURI, String localName, boolean isId) throws DOMException
- Specified by:
 setIdAttributeNSin interfaceElement- Throws:
 DOMException
 
- 
setIdAttributeNode
public void setIdAttributeNode(Attr idAttr, boolean isId) throws DOMException
- Specified by:
 setIdAttributeNodein interfaceElement- Throws:
 DOMException
 
- 
getBaseURI
public String getBaseURI()
- Specified by:
 getBaseURIin interfaceNode
 
- 
compareDocumentPosition
public short compareDocumentPosition(Node other) throws DOMException
- Specified by:
 compareDocumentPositionin interfaceNode- Throws:
 DOMException
 
- 
getTextContent
public String getTextContent() throws DOMException
- Specified by:
 getTextContentin interfaceNode- Throws:
 DOMException
 
- 
setTextContent
public void setTextContent(String textContent) throws DOMException
- Specified by:
 setTextContentin interfaceNode- Throws:
 DOMException
 
- 
isSameNode
public boolean isSameNode(Node other)
- Specified by:
 isSameNodein interfaceNode
 
- 
lookupPrefix
public String lookupPrefix(String namespaceURI)
- Specified by:
 lookupPrefixin interfaceNode
 
- 
isDefaultNamespace
public boolean isDefaultNamespace(String namespaceURI)
- Specified by:
 isDefaultNamespacein interfaceNode
 
- 
lookupNamespaceURI
public String lookupNamespaceURI(String prefix)
- Specified by:
 lookupNamespaceURIin interfaceNode
 
- 
isEqualNode
public boolean isEqualNode(Node other)
- Specified by:
 isEqualNodein interfaceNode
 
- 
getFeature
public Object getFeature(String feature, String version)
- Specified by:
 getFeaturein interfaceNode
 
- 
setUserData
public Object setUserData(String key, Object data, UserDataHandler handler)
- Specified by:
 setUserDatain interfaceNode
 
- 
getUserData
public Object getUserData(String key)
- Specified by:
 getUserDatain interfaceNode
 
 - 
 
 -