org.dom4j.dom
Class DOMDocument

java.lang.Object
  extended byorg.dom4j.tree.AbstractNode
      extended byorg.dom4j.tree.AbstractBranch
          extended byorg.dom4j.tree.AbstractDocument
              extended byorg.dom4j.tree.DefaultDocument
                  extended byorg.dom4j.dom.DOMDocument
All Implemented Interfaces:
Branch, Cloneable, Document, Document, Node, Node, Serializable

public class DOMDocument
extends DefaultDocument
implements Document

DOMDocument implements an XML document which supports the W3C DOM API.

Version:
$Revision: 1.17 $
Author:
James Strachan
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.dom4j.tree.DefaultDocument
EMPTY_ITERATOR, EMPTY_LIST
 
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.w3c.dom.Node
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE
 
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
 
Constructor Summary
DOMDocument()
           
DOMDocument(DOMDocumentType docType)
           
DOMDocument(DOMElement rootElement)
           
DOMDocument(DOMElement rootElement, DOMDocumentType docType)
           
DOMDocument(String name)
           
DOMDocument(String name, DOMElement rootElement, DOMDocumentType docType)
           
 
Method Summary
 Node appendChild(Node newChild)
           
 Node cloneNode(boolean deep)
           
 Attr createAttribute(String name)
           
 Attr createAttributeNS(String namespaceURI, String qualifiedName)
           
 CDATASection createCDATASection(String data)
           
 Comment createComment(String data)
           
 DocumentFragment createDocumentFragment()
           
 Element createElement(String name)
           
 Element createElementNS(String namespaceURI, String qualifiedName)
           
 EntityReference createEntityReference(String name)
           
 ProcessingInstruction createProcessingInstruction(String target, String data)
           
 Text createTextNode(String data)
           
 NamedNodeMap getAttributes()
           
 NodeList getChildNodes()
           
 DocumentType getDoctype()
           
 Element getDocumentElement()
           
protected  DocumentFactory getDocumentFactory()
           
 Element getElementById(String elementId)
           
 NodeList getElementsByTagName(String name)
           
 NodeList getElementsByTagNameNS(String namespace, String name)
           
 Node getFirstChild()
           
 DOMImplementation getImplementation()
           
 Node getLastChild()
           
 String getLocalName()
           
 String getNamespaceURI()
           
 Node getNextSibling()
           
 String getNodeName()
           
 String getNodeValue()
           
 Document getOwnerDocument()
           
 Node getParentNode()
           
 String getPrefix()
           
 Node getPreviousSibling()
           
 boolean hasAttributes()
           
 boolean hasChildNodes()
           
 Node importNode(Node importedNode, boolean deep)
           
 Node insertBefore(Node newChild, Node refChild)
           
 boolean isSupported(String feature, String version)
           
 Node removeChild(Node oldChild)
           
 Node replaceChild(Node newChild, Node oldChild)
           
 void setNodeValue(String nodeValue)
           
 void setPrefix(String prefix)
           
 boolean supports(String feature, String version)
           
 
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.w3c.dom.Node
getNodeType, normalize
 
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
 

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

supports

public boolean supports(String feature,
                        String version)

getNamespaceURI

public String getNamespaceURI()
Specified by:
getNamespaceURI in interface Node

getPrefix

public String getPrefix()
Specified by:
getPrefix in interface Node

setPrefix

public void setPrefix(String prefix)
               throws DOMException
Specified by:
setPrefix in interface Node
Throws:
DOMException

getLocalName

public String getLocalName()
Specified by:
getLocalName in interface Node

getNodeName

public String getNodeName()
Specified by:
getNodeName in interface Node

getNodeValue

public String getNodeValue()
                    throws DOMException
Specified by:
getNodeValue in interface Node
Throws:
DOMException

setNodeValue

public void setNodeValue(String nodeValue)
                  throws DOMException
Specified by:
setNodeValue in interface Node
Throws:
DOMException

getParentNode

public Node getParentNode()
Specified by:
getParentNode in interface Node

getChildNodes

public NodeList getChildNodes()
Specified by:
getChildNodes in interface Node

getFirstChild

public Node getFirstChild()
Specified by:
getFirstChild in interface Node

getLastChild

public Node getLastChild()
Specified by:
getLastChild in interface Node

getPreviousSibling

public Node getPreviousSibling()
Specified by:
getPreviousSibling in interface Node

getNextSibling

public Node getNextSibling()
Specified by:
getNextSibling in interface Node

getAttributes

public NamedNodeMap getAttributes()
Specified by:
getAttributes in interface Node

getOwnerDocument

public Document getOwnerDocument()
Specified by:
getOwnerDocument in interface Node

insertBefore

public Node insertBefore(Node newChild,
                         Node refChild)
                  throws DOMException
Specified by:
insertBefore in interface Node
Throws:
DOMException

replaceChild

public Node replaceChild(Node newChild,
                         Node oldChild)
                  throws DOMException
Specified by:
replaceChild in interface Node
Throws:
DOMException

removeChild

public Node removeChild(Node oldChild)
                 throws DOMException
Specified by:
removeChild in interface Node
Throws:
DOMException

appendChild

public Node appendChild(Node newChild)
                 throws DOMException
Specified by:
appendChild in interface Node
Throws:
DOMException

hasChildNodes

public boolean hasChildNodes()
Specified by:
hasChildNodes in interface Node

cloneNode

public Node cloneNode(boolean deep)
Specified by:
cloneNode in interface Node

isSupported

public boolean isSupported(String feature,
                           String version)
Specified by:
isSupported in interface Node

hasAttributes

public boolean hasAttributes()
Specified by:
hasAttributes in interface Node

getElementsByTagName

public NodeList getElementsByTagName(String name)
Specified by:
getElementsByTagName in interface Document

getElementsByTagNameNS

public NodeList getElementsByTagNameNS(String namespace,
                                       String name)
Specified by:
getElementsByTagNameNS in interface Document

getDoctype

public DocumentType getDoctype()
Specified by:
getDoctype in interface Document

getImplementation

public DOMImplementation getImplementation()
Specified by:
getImplementation in interface Document

getDocumentElement

public Element getDocumentElement()
Specified by:
getDocumentElement in interface Document

createElement

public Element createElement(String name)
                      throws DOMException
Specified by:
createElement in interface Document
Throws:
DOMException

createDocumentFragment

public DocumentFragment createDocumentFragment()
Specified by:
createDocumentFragment in interface Document

createTextNode

public Text createTextNode(String data)
Specified by:
createTextNode in interface Document

createComment

public Comment createComment(String data)
Specified by:
createComment in interface Document

createCDATASection

public CDATASection createCDATASection(String data)
                                throws DOMException
Specified by:
createCDATASection in interface Document
Throws:
DOMException

createProcessingInstruction

public ProcessingInstruction createProcessingInstruction(String target,
                                                         String data)
                                                  throws DOMException
Specified by:
createProcessingInstruction in interface Document
Throws:
DOMException

createAttribute

public Attr createAttribute(String name)
                     throws DOMException
Specified by:
createAttribute in interface Document
Throws:
DOMException

createEntityReference

public EntityReference createEntityReference(String name)
                                      throws DOMException
Specified by:
createEntityReference in interface Document
Throws:
DOMException

importNode

public Node importNode(Node importedNode,
                       boolean deep)
                throws DOMException
Specified by:
importNode in interface Document
Throws:
DOMException

createElementNS

public Element createElementNS(String namespaceURI,
                               String qualifiedName)
                        throws DOMException
Specified by:
createElementNS in interface Document
Throws:
DOMException

createAttributeNS

public Attr createAttributeNS(String namespaceURI,
                              String qualifiedName)
                       throws DOMException
Specified by:
createAttributeNS in interface Document
Throws:
DOMException

getElementById

public Element getElementById(String elementId)
Specified by:
getElementById in interface Document

getDocumentFactory

protected DocumentFactory getDocumentFactory()
Overrides:
getDocumentFactory in class DefaultDocument


Copyright © 2001-2005 MetaStuff Ltd.. All Rights Reserved.