Package org.dom4j.dom
Class DOMDocument
- 
public class DOMDocument extends DefaultDocument implements Document
DOMDocumentimplements an XML document which supports the W3C DOM API.- See Also:
 - Serialized Form
 
 
- 
- 
Field Summary
- 
Fields inherited from class org.dom4j.tree.AbstractDocument
encoding 
- 
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 DOMDocument()DOMDocument(String name)DOMDocument(String name, DOMElement rootElement, DOMDocumentType docType)DOMDocument(DOMDocumentType docType)DOMDocument(DOMElement rootElement)DOMDocument(DOMElement rootElement, DOMDocumentType docType) 
- 
Method Summary
- 
Methods inherited from class org.dom4j.tree.DefaultDocument
addDocType, addNode, addNode, clearContent, clone, contentList, getDocType, getEntityResolver, getName, getRootElement, getXMLEncoding, processingInstruction, processingInstructions, processingInstructions, removeNode, removeProcessingInstruction, rootElementAdded, setContent, setDocType, setDocumentFactory, setEntityResolver, setName 
- 
Methods inherited from class org.dom4j.tree.AbstractDocument
accept, add, addComment, addElement, addElement, addElement, addProcessingInstruction, addProcessingInstruction, asXML, asXPathResult, checkAddElementAllowed, childAdded, childRemoved, getDocument, getNodeType, getPath, getStringValue, getUniquePath, normalize, remove, setRootElement, setXMLEncoding, toString, write 
- 
Methods inherited from class org.dom4j.tree.AbstractBranch
add, add, add, addElement, appendContent, content, contentRemoved, createContentList, createContentList, createEmptyList, createResultList, createSingleResultList, elementByID, elementID, getContentAsStringValue, getContentAsText, getText, getTextTrim, hasContent, indexOf, invalidNodeTypeAddException, isReadOnly, node, nodeCount, nodeIterator, remove, remove, remove, setProcessingInstructions 
- 
Methods inherited from class org.dom4j.tree.AbstractNode
createPattern, createXPath, createXPathFilter, createXPathResult, detach, getNodeTypeName, getParent, getPath, getUniquePath, matches, numberValueOf, selectNodes, selectNodes, selectNodes, selectObject, selectSingleNode, setDocument, setParent, setText, supportsParent, valueOf 
- 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait 
- 
Methods inherited from interface org.dom4j.Branch
add, add, add, appendContent, content, elementByID, indexOf, node, nodeCount, nodeIterator, remove, remove, remove, setProcessingInstructions 
- 
Methods inherited from interface org.dom4j.Node
createXPath, detach, getNodeTypeName, getParent, getPath, getText, getUniquePath, hasContent, isReadOnly, matches, numberValueOf, selectNodes, selectNodes, selectNodes, selectObject, selectSingleNode, setDocument, setParent, setText, supportsParent, valueOf 
- 
Methods inherited from interface org.w3c.dom.Node
getNodeType, normalize 
 - 
 
 - 
 
- 
- 
Constructor Detail
- 
DOMDocument
public DOMDocument()
 
- 
DOMDocument
public DOMDocument(String name)
 
- 
DOMDocument
public DOMDocument(DOMElement rootElement)
 
- 
DOMDocument
public DOMDocument(DOMDocumentType docType)
 
- 
DOMDocument
public DOMDocument(DOMElement rootElement, DOMDocumentType docType)
 
- 
DOMDocument
public DOMDocument(String name, DOMElement rootElement, DOMDocumentType docType)
 
 - 
 
- 
Method Detail
- 
getNamespaceURI
public String getNamespaceURI()
- Specified by:
 getNamespaceURIin interfaceNode
 
- 
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
 
- 
getElementsByTagName
public NodeList getElementsByTagName(String name)
- Specified by:
 getElementsByTagNamein interfaceDocument
 
- 
getElementsByTagNameNS
public NodeList getElementsByTagNameNS(String namespace, String name)
- Specified by:
 getElementsByTagNameNSin interfaceDocument
 
- 
getDoctype
public DocumentType getDoctype()
- Specified by:
 getDoctypein interfaceDocument
 
- 
getImplementation
public DOMImplementation getImplementation()
- Specified by:
 getImplementationin interfaceDocument
 
- 
getDocumentElement
public Element getDocumentElement()
- Specified by:
 getDocumentElementin interfaceDocument
 
- 
createElement
public Element createElement(String name) throws DOMException
- Specified by:
 createElementin interfaceDocument- Throws:
 DOMException
 
- 
createDocumentFragment
public DocumentFragment createDocumentFragment()
- Specified by:
 createDocumentFragmentin interfaceDocument
 
- 
createTextNode
public Text createTextNode(String data)
- Specified by:
 createTextNodein interfaceDocument
 
- 
createComment
public Comment createComment(String data)
- Specified by:
 createCommentin interfaceDocument
 
- 
createCDATASection
public CDATASection createCDATASection(String data) throws DOMException
- Specified by:
 createCDATASectionin interfaceDocument- Throws:
 DOMException
 
- 
createProcessingInstruction
public ProcessingInstruction createProcessingInstruction(String target, String data) throws DOMException
- Specified by:
 createProcessingInstructionin interfaceDocument- Throws:
 DOMException
 
- 
createAttribute
public Attr createAttribute(String name) throws DOMException
- Specified by:
 createAttributein interfaceDocument- Throws:
 DOMException
 
- 
createEntityReference
public EntityReference createEntityReference(String name) throws DOMException
- Specified by:
 createEntityReferencein interfaceDocument- Throws:
 DOMException
 
- 
importNode
public Node importNode(Node importedNode, boolean deep) throws DOMException
- Specified by:
 importNodein interfaceDocument- Throws:
 DOMException
 
- 
createElementNS
public Element createElementNS(String namespaceURI, String qualifiedName) throws DOMException
- Specified by:
 createElementNSin interfaceDocument- Throws:
 DOMException
 
- 
createAttributeNS
public Attr createAttributeNS(String namespaceURI, String qualifiedName) throws DOMException
- Specified by:
 createAttributeNSin interfaceDocument- Throws:
 DOMException
 
- 
getElementById
public Element getElementById(String elementId)
- Specified by:
 getElementByIdin interfaceDocument
 
- 
getDocumentFactory
protected DocumentFactory getDocumentFactory()
- Overrides:
 getDocumentFactoryin classDefaultDocument
 
- 
getInputEncoding
public String getInputEncoding()
- Specified by:
 getInputEncodingin interfaceDocument
 
- 
getXmlEncoding
public String getXmlEncoding()
- Specified by:
 getXmlEncodingin interfaceDocument
 
- 
getXmlStandalone
public boolean getXmlStandalone()
- Specified by:
 getXmlStandalonein interfaceDocument
 
- 
setXmlStandalone
public void setXmlStandalone(boolean xmlStandalone) throws DOMException- Specified by:
 setXmlStandalonein interfaceDocument- Throws:
 DOMException
 
- 
getXmlVersion
public String getXmlVersion()
- Specified by:
 getXmlVersionin interfaceDocument
 
- 
setXmlVersion
public void setXmlVersion(String xmlVersion) throws DOMException
- Specified by:
 setXmlVersionin interfaceDocument- Throws:
 DOMException
 
- 
getStrictErrorChecking
public boolean getStrictErrorChecking()
- Specified by:
 getStrictErrorCheckingin interfaceDocument
 
- 
setStrictErrorChecking
public void setStrictErrorChecking(boolean strictErrorChecking)
- Specified by:
 setStrictErrorCheckingin interfaceDocument
 
- 
getDocumentURI
public String getDocumentURI()
- Specified by:
 getDocumentURIin interfaceDocument
 
- 
setDocumentURI
public void setDocumentURI(String documentURI)
- Specified by:
 setDocumentURIin interfaceDocument
 
- 
adoptNode
public Node adoptNode(Node source) throws DOMException
- Specified by:
 adoptNodein interfaceDocument- Throws:
 DOMException
 
- 
getDomConfig
public DOMConfiguration getDomConfig()
- Specified by:
 getDomConfigin interfaceDocument
 
- 
normalizeDocument
public void normalizeDocument()
- Specified by:
 normalizeDocumentin interfaceDocument
 
- 
renameNode
public Node renameNode(Node n, String namespaceURI, String qualifiedName) throws DOMException
- Specified by:
 renameNodein interfaceDocument- 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
 
 - 
 
 -