Package org.dom4j.dom
Class DOMDocument
DOMDocument
implements an XML document which supports the W3C
DOM API.
- Version:
- $Revision: 1.17 $
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final DOMDocumentFactory
TheDocumentFactory
instance used by defaultFields 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
ConstructorsConstructorDescriptionDOMDocument
(String name) DOMDocument
(String name, DOMElement rootElement, DOMDocumentType docType) DOMDocument
(DOMDocumentType docType) DOMDocument
(DOMElement rootElement) DOMDocument
(DOMElement rootElement, DOMDocumentType docType) -
Method Summary
Modifier and TypeMethodDescriptionappendChild
(Node newChild) private void
checkNewChildNode
(Node newChild) cloneNode
(boolean deep) short
compareDocumentPosition
(Node other) createAttribute
(String name) createAttributeNS
(String namespaceURI, String qualifiedName) createCDATASection
(String data) createComment
(String data) createElement
(String name) createElementNS
(String namespaceURI, String qualifiedName) createEntityReference
(String name) createProcessingInstruction
(String target, String data) createTextNode
(String data) protected DocumentFactory
getElementById
(String elementId) getElementsByTagName
(String name) getElementsByTagNameNS
(String namespace, String name) getFeature
(String feature, String version) boolean
getUserData
(String key) boolean
boolean
boolean
importNode
(Node importedNode, boolean deep) private void
init()
insertBefore
(Node newChild, Node refChild) boolean
isDefaultNamespace
(String namespaceURI) boolean
isEqualNode
(Node other) boolean
isSameNode
(Node other) boolean
isSupported
(String feature, String version) lookupNamespaceURI
(String prefix) lookupPrefix
(String namespaceURI) void
removeChild
(Node oldChild) renameNode
(Node n, String namespaceURI, String qualifiedName) replaceChild
(Node newChild, Node oldChild) void
setDocumentURI
(String documentURI) void
setNodeValue
(String nodeValue) void
void
setStrictErrorChecking
(boolean strictErrorChecking) void
setTextContent
(String textContent) setUserData
(String key, Object data, UserDataHandler handler) void
setXmlStandalone
(boolean xmlStandalone) void
setXmlVersion
(String xmlVersion) boolean
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
-
Field Details
-
DOCUMENT_FACTORY
TheDocumentFactory
instance used by default
-
-
Constructor Details
-
DOMDocument
public DOMDocument() -
DOMDocument
-
DOMDocument
-
DOMDocument
-
DOMDocument
-
DOMDocument
-
-
Method Details
-
init
private void init() -
supports
-
getNamespaceURI
- Specified by:
getNamespaceURI
in interfaceNode
-
getPrefix
-
setPrefix
- Specified by:
setPrefix
in interfaceNode
- Throws:
DOMException
-
getLocalName
- Specified by:
getLocalName
in interfaceNode
-
getNodeName
- Specified by:
getNodeName
in interfaceNode
-
getNodeValue
- Specified by:
getNodeValue
in interfaceNode
- Throws:
DOMException
-
setNodeValue
- Specified by:
setNodeValue
in interfaceNode
- Throws:
DOMException
-
getParentNode
- Specified by:
getParentNode
in interfaceNode
-
getChildNodes
- Specified by:
getChildNodes
in interfaceNode
-
getFirstChild
- Specified by:
getFirstChild
in interfaceNode
-
getLastChild
- Specified by:
getLastChild
in interfaceNode
-
getPreviousSibling
- Specified by:
getPreviousSibling
in interfaceNode
-
getNextSibling
- Specified by:
getNextSibling
in interfaceNode
-
getAttributes
- Specified by:
getAttributes
in interfaceNode
-
getOwnerDocument
- Specified by:
getOwnerDocument
in interfaceNode
-
insertBefore
- Specified by:
insertBefore
in interfaceNode
- Throws:
DOMException
-
replaceChild
- Specified by:
replaceChild
in interfaceNode
- Throws:
DOMException
-
removeChild
- Specified by:
removeChild
in interfaceNode
- Throws:
DOMException
-
appendChild
- Specified by:
appendChild
in interfaceNode
- Throws:
DOMException
-
checkNewChildNode
- Throws:
DOMException
-
hasChildNodes
public boolean hasChildNodes()- Specified by:
hasChildNodes
in interfaceNode
-
cloneNode
-
isSupported
- Specified by:
isSupported
in interfaceNode
-
hasAttributes
public boolean hasAttributes()- Specified by:
hasAttributes
in interfaceNode
-
getElementsByTagName
- Specified by:
getElementsByTagName
in interfaceDocument
-
getElementsByTagNameNS
- Specified by:
getElementsByTagNameNS
in interfaceDocument
-
getDoctype
- Specified by:
getDoctype
in interfaceDocument
-
getImplementation
- Specified by:
getImplementation
in interfaceDocument
-
getDocumentElement
- Specified by:
getDocumentElement
in interfaceDocument
-
createElement
- Specified by:
createElement
in interfaceDocument
- Throws:
DOMException
-
createDocumentFragment
- Specified by:
createDocumentFragment
in interfaceDocument
-
createTextNode
- Specified by:
createTextNode
in interfaceDocument
-
createComment
- Specified by:
createComment
in interfaceDocument
-
createCDATASection
- Specified by:
createCDATASection
in interfaceDocument
- Throws:
DOMException
-
createProcessingInstruction
public ProcessingInstruction createProcessingInstruction(String target, String data) throws DOMException - Specified by:
createProcessingInstruction
in interfaceDocument
- Throws:
DOMException
-
createAttribute
- Specified by:
createAttribute
in interfaceDocument
- Throws:
DOMException
-
createEntityReference
- Specified by:
createEntityReference
in interfaceDocument
- Throws:
DOMException
-
importNode
- Specified by:
importNode
in interfaceDocument
- Throws:
DOMException
-
createElementNS
- Specified by:
createElementNS
in interfaceDocument
- Throws:
DOMException
-
createAttributeNS
- Specified by:
createAttributeNS
in interfaceDocument
- Throws:
DOMException
-
getElementById
- Specified by:
getElementById
in interfaceDocument
-
getDocumentFactory
- Overrides:
getDocumentFactory
in classDefaultDocument
-
getInputEncoding
- Specified by:
getInputEncoding
in interfaceDocument
-
getXmlEncoding
- Specified by:
getXmlEncoding
in interfaceDocument
-
getXmlStandalone
public boolean getXmlStandalone()- Specified by:
getXmlStandalone
in interfaceDocument
-
setXmlStandalone
- Specified by:
setXmlStandalone
in interfaceDocument
- Throws:
DOMException
-
getXmlVersion
- Specified by:
getXmlVersion
in interfaceDocument
-
setXmlVersion
- Specified by:
setXmlVersion
in interfaceDocument
- Throws:
DOMException
-
getStrictErrorChecking
public boolean getStrictErrorChecking()- Specified by:
getStrictErrorChecking
in interfaceDocument
-
setStrictErrorChecking
public void setStrictErrorChecking(boolean strictErrorChecking) - Specified by:
setStrictErrorChecking
in interfaceDocument
-
getDocumentURI
- Specified by:
getDocumentURI
in interfaceDocument
-
setDocumentURI
- Specified by:
setDocumentURI
in interfaceDocument
-
adoptNode
- Specified by:
adoptNode
in interfaceDocument
- Throws:
DOMException
-
getDomConfig
- Specified by:
getDomConfig
in interfaceDocument
-
normalizeDocument
public void normalizeDocument()- Specified by:
normalizeDocument
in interfaceDocument
-
renameNode
- Specified by:
renameNode
in interfaceDocument
- Throws:
DOMException
-
getBaseURI
- Specified by:
getBaseURI
in interfaceNode
-
compareDocumentPosition
- Specified by:
compareDocumentPosition
in interfaceNode
- Throws:
DOMException
-
getTextContent
- Specified by:
getTextContent
in interfaceNode
- Throws:
DOMException
-
setTextContent
- Specified by:
setTextContent
in interfaceNode
- Throws:
DOMException
-
isSameNode
- Specified by:
isSameNode
in interfaceNode
-
lookupPrefix
- Specified by:
lookupPrefix
in interfaceNode
-
isDefaultNamespace
- Specified by:
isDefaultNamespace
in interfaceNode
-
lookupNamespaceURI
- Specified by:
lookupNamespaceURI
in interfaceNode
-
isEqualNode
- Specified by:
isEqualNode
in interfaceNode
-
getFeature
- Specified by:
getFeature
in interfaceNode
-
setUserData
- Specified by:
setUserData
in interfaceNode
-
getUserData
- Specified by:
getUserData
in interfaceNode
-