public class Document extends AbstractGroup implements org.w3c.dom.Document
Element
,
Serialized FormModifier and Type | Class and Description |
---|---|
protected class |
Document.ChildArray |
AbstractGroup.ElementMap
_children
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
FIND_BY_PREFIX, FIND_BY_REGEX, FIND_BY_TAGNAME, FIND_IGNORE_CASE, FIND_RECURSIVE
Constructor and Description |
---|
Document()
Constructor.
|
Document(Element root)
Constructor.
|
Document(Element root,
DocType dt)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
org.w3c.dom.Node |
adoptNode(org.w3c.dom.Node source) |
org.w3c.dom.Attr |
createAttribute(java.lang.String lname) |
org.w3c.dom.Attr |
createAttributeNS(java.lang.String nsURI,
java.lang.String tname) |
org.w3c.dom.CDATASection |
createCDATASection(java.lang.String data) |
org.w3c.dom.Comment |
createComment(java.lang.String data) |
org.w3c.dom.DocumentFragment |
createDocumentFragment() |
org.w3c.dom.Element |
createElement(java.lang.String lname) |
org.w3c.dom.Element |
createElementNS(java.lang.String nsURI,
java.lang.String tname) |
org.w3c.dom.EntityReference |
createEntityReference(java.lang.String name) |
org.w3c.dom.ProcessingInstruction |
createProcessingInstruction(java.lang.String target,
java.lang.String data) |
org.w3c.dom.Text |
createTextNode(java.lang.String data) |
org.w3c.dom.DocumentType |
getDoctype() |
DocType |
getDocType()
Gets the document type.
|
org.w3c.dom.Element |
getDocumentElement() |
java.lang.String |
getDocumentURI() |
org.w3c.dom.DOMConfiguration |
getDomConfig() |
org.w3c.dom.Element |
getElementById(java.lang.String elementId) |
org.w3c.dom.NodeList |
getElementsByTagName(java.lang.String tname)
Gets elements that matches the tag name.
|
org.w3c.dom.NodeList |
getElementsByTagNameNS(java.lang.String nsURI,
java.lang.String lname)
Gets elements that matches the tag name and namespace.
|
org.w3c.dom.DOMImplementation |
getImplementation() |
java.lang.String |
getInputEncoding() |
java.lang.String |
getName()
Gets the name of the item.
|
short |
getNodeType() |
Element |
getRootElement()
Gets the root element.
|
boolean |
getStrictErrorChecking() |
java.lang.String |
getXmlEncoding() |
boolean |
getXmlStandalone() |
java.lang.String |
getXmlVersion() |
org.w3c.dom.Node |
importNode(org.w3c.dom.Node importedNode,
boolean deep) |
protected java.util.List<Item> |
newChildren()
Creates a list to hold child vertices.
|
void |
normalizeDocument() |
org.w3c.dom.Node |
renameNode(org.w3c.dom.Node n,
java.lang.String namespaceURI,
java.lang.String qualifiedName) |
void |
setDocType(DocType docType)
Sets the document type.
|
void |
setDocumentURI(java.lang.String documentURI) |
void |
setRootElement(Element root)
Sets the root element.
|
void |
setStrictErrorChecking(boolean strictErrorChecking) |
void |
setXmlStandalone(boolean xmlStandalone) |
void |
setXmlVersion(java.lang.String xmlVersion) |
java.lang.String |
toString() |
anyElement, appendChild, clone, coalesce, detachChildren, getChildNodes, getChildren, getElement, getElement, getElementIndex, getElementIndex, getElementNames, getElements, getElements, getElements, getElementValue, getElementValue, getFirstChild, getLastChild, hasChildNodes, insertBefore, removeChild, replaceChild
cloneNode, compareDocumentPosition, detach, equals, getAttributes, getBaseURI, getDocument, getFeature, getLocalName, getLocator, getNamespaceURI, getNextSibling, getNodeName, getNodeValue, getOwnerDocument, getParent, getParentNode, getPrefix, getPreviousSibling, getText, getTextContent, getUserData, hasAttributes, hashCode, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, match, normalize, setLocator, setName, setNodeValue, setParent, setPrefix, setText, setTextContent, setUserData
finalize, getClass, notify, notifyAll, wait, wait, wait
appendChild, cloneNode, compareDocumentPosition, getAttributes, getBaseURI, getChildNodes, getFeature, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, getTextContent, getUserData, hasAttributes, hasChildNodes, insertBefore, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, removeChild, replaceChild, setNodeValue, setPrefix, setTextContent, setUserData
detach, getDocument, getLocator, getParent, getText, setLocator, setName, setParent, setText
public Document(Element root)
public Document()
public final Element getRootElement()
public final void setRootElement(Element root)
public final DocType getDocType()
public final void setDocType(DocType docType)
protected final java.util.List<Item> newChildren()
AbstractGroup
The default implementation obeys the semantic of Element, i.e., it doen't allow any child that cannot be a child of Element.
For performance issue, we introduced a map to improve the search speed for Element node associated with a tag name.
newChildren
in class AbstractGroup
public final java.lang.String getName()
Item
getName
in interface Item
Namespaceable.getTagName()
public final short getNodeType()
getNodeType
in interface org.w3c.dom.Node
public final org.w3c.dom.DocumentType getDoctype()
getDoctype
in interface org.w3c.dom.Document
public final org.w3c.dom.Element getDocumentElement()
getDocumentElement
in interface org.w3c.dom.Document
public final org.w3c.dom.DOMImplementation getImplementation()
getImplementation
in interface org.w3c.dom.Document
public final org.w3c.dom.Element createElement(java.lang.String lname)
createElement
in interface org.w3c.dom.Document
public final org.w3c.dom.Element createElementNS(java.lang.String nsURI, java.lang.String tname)
createElementNS
in interface org.w3c.dom.Document
public final org.w3c.dom.Attr createAttribute(java.lang.String lname)
createAttribute
in interface org.w3c.dom.Document
public final org.w3c.dom.Attr createAttributeNS(java.lang.String nsURI, java.lang.String tname)
createAttributeNS
in interface org.w3c.dom.Document
public final org.w3c.dom.DocumentFragment createDocumentFragment()
createDocumentFragment
in interface org.w3c.dom.Document
public final org.w3c.dom.Text createTextNode(java.lang.String data)
createTextNode
in interface org.w3c.dom.Document
public final org.w3c.dom.Comment createComment(java.lang.String data)
createComment
in interface org.w3c.dom.Document
public final org.w3c.dom.CDATASection createCDATASection(java.lang.String data)
createCDATASection
in interface org.w3c.dom.Document
public final org.w3c.dom.ProcessingInstruction createProcessingInstruction(java.lang.String target, java.lang.String data)
createProcessingInstruction
in interface org.w3c.dom.Document
public final org.w3c.dom.EntityReference createEntityReference(java.lang.String name)
createEntityReference
in interface org.w3c.dom.Document
public final org.w3c.dom.NodeList getElementsByTagName(java.lang.String tname)
Unlike other implementations (Xerces or Crimson), the returned list is a snapshot of the current tree -- not a "live" representation.
getElementsByTagName
in interface org.w3c.dom.Document
public final org.w3c.dom.NodeList getElementsByTagNameNS(java.lang.String nsURI, java.lang.String lname)
Unlike other implementations (Xerces or Crimson), the returned list is a snapshot of the current tree -- not a "live" representation.
getElementsByTagNameNS
in interface org.w3c.dom.Document
public final org.w3c.dom.Element getElementById(java.lang.String elementId)
getElementById
in interface org.w3c.dom.Document
public final org.w3c.dom.Node importNode(org.w3c.dom.Node importedNode, boolean deep)
importNode
in interface org.w3c.dom.Document
public java.lang.String getInputEncoding()
getInputEncoding
in interface org.w3c.dom.Document
public java.lang.String getXmlEncoding()
getXmlEncoding
in interface org.w3c.dom.Document
public boolean getXmlStandalone()
getXmlStandalone
in interface org.w3c.dom.Document
public void setXmlStandalone(boolean xmlStandalone) throws DOMException
setXmlStandalone
in interface org.w3c.dom.Document
DOMException
public java.lang.String getXmlVersion()
getXmlVersion
in interface org.w3c.dom.Document
public void setXmlVersion(java.lang.String xmlVersion) throws DOMException
setXmlVersion
in interface org.w3c.dom.Document
DOMException
public boolean getStrictErrorChecking()
getStrictErrorChecking
in interface org.w3c.dom.Document
public void setStrictErrorChecking(boolean strictErrorChecking)
setStrictErrorChecking
in interface org.w3c.dom.Document
public java.lang.String getDocumentURI()
getDocumentURI
in interface org.w3c.dom.Document
public void setDocumentURI(java.lang.String documentURI)
setDocumentURI
in interface org.w3c.dom.Document
public org.w3c.dom.Node adoptNode(org.w3c.dom.Node source) throws DOMException
adoptNode
in interface org.w3c.dom.Document
DOMException
public org.w3c.dom.DOMConfiguration getDomConfig()
getDomConfig
in interface org.w3c.dom.Document
public void normalizeDocument()
normalizeDocument
in interface org.w3c.dom.Document
public org.w3c.dom.Node renameNode(org.w3c.dom.Node n, java.lang.String namespaceURI, java.lang.String qualifiedName) throws DOMException
renameNode
in interface org.w3c.dom.Document
DOMException
public final java.lang.String toString()
toString
in class java.lang.Object
Copyright © 2005-2011 Potix Corporation. All Rights Reserved.