public class DocumentImpl extends ParentNode implements Document, OMDocument
| Modifier and Type | Field and Description |
|---|---|
protected ElementImpl |
documentElement |
protected Hashtable |
identifiers |
firstChild, lastChildnextSibling, parentNode, previousSiblingbuilder, done, factory, FIRSTCHILD, flags, NORMALIZED, OWNED, ownerNode, READONLY, SPECIFIEDATTRIBUTE_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_NODEXML_10, XML_11DTD_NODE, PI_NODE, SPACE_NODE| Constructor and Description |
|---|
DocumentImpl(DocumentImpl ownerDocument,
OMFactory factory) |
DocumentImpl(OMFactory factory) |
DocumentImpl(OMXMLParserWrapper parserWrapper,
OMFactory factory) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addIdAttr(Attr attr) |
Node |
adoptNode(Node node) |
protected void |
checkQName(String prefix,
String local)
Borrowed from the Xerces impl.
|
Attr |
createAttribute(String name) |
Attr |
createAttributeNS(String namespaceURI,
String qualifiedName) |
CDATASection |
createCDATASection(String arg0) |
Comment |
createComment(String data) |
DocumentFragment |
createDocumentFragment() |
Element |
createElement(String tagName) |
Element |
createElementNS(String ns,
String qualifiedName) |
EntityReference |
createEntityReference(String arg0) |
ProcessingInstruction |
createProcessingInstruction(String target,
String data) |
Text |
createTextNode(String value) |
String |
getCharsetEncoding()
Get the character set encoding scheme.
|
DocumentType |
getDoctype() |
Element |
getDocumentElement()
Returns the document element.
|
String |
getDocumentURI() |
DOMConfiguration |
getDomConfig() |
Element |
getElementById(String elementId) |
NodeList |
getElementsByTagName(String arg0) |
NodeList |
getElementsByTagNameNS(String arg0,
String arg1) |
DOMImplementation |
getImplementation() |
String |
getInputEncoding() |
OMNode |
getNextOMSibling()
Default behavior returns null, overriden in ChildNode.
|
Node |
getNextSibling()
Returns the next child of this node's parent, or null if none.
|
String |
getNodeName() |
short |
getNodeType() |
OMElement |
getOMDocumentElement()
Returns the document element.
|
OMContainer |
getParent()
Returns the parent containing node.
|
OMNode |
getPreviousOMSibling()
Default behavior returns null, overriden in ChildNode.
|
Node |
getPreviousSibling()
Returns the previous child of this node's parent, or null if none.
|
boolean |
getStrictErrorChecking() |
String |
getTextContent() |
int |
getType()
Returns the type of node.
|
String |
getXmlEncoding() |
String |
getXMLEncoding()
Get the charset encoding of this document as specified in the XML declaration.
|
boolean |
getXmlStandalone() |
String |
getXmlVersion() |
String |
getXMLVersion()
Returns the XML version.
|
Node |
importNode(Node importedNode,
boolean deep) |
void |
internalSerialize(XMLStreamWriter writer,
boolean cache)
Serializes the node.
|
protected void |
internalSerialize(XMLStreamWriter writer,
boolean cache,
boolean includeXMLDeclaration) |
String |
isStandalone()
XML standalone value.
|
void |
normalizeDocument() |
protected void |
removeIdAttr(Attr attr) |
Node |
renameNode(Node arg0,
String arg1,
String arg2) |
void |
serialize(OutputStream output,
OMOutputFormat format)
Serializes the node with caching.
|
void |
serializeAndConsume(OutputStream output,
OMOutputFormat format)
Serializes the node without caching.
|
void |
setCharsetEncoding(String charsetEncoding)
Sets the character set encoding scheme to be used.
|
void |
setDocumentURI(String arg0) |
void |
setNextOMSibling(OMNode node) |
void |
setOMDocumentElement(OMElement rootElement)
Sets the document element of the XML document.
|
void |
setParent(OMContainer element) |
void |
setPreviousOMSibling(OMNode node) |
void |
setStandalone(String isStandalone) |
void |
setStrictErrorChecking(boolean arg0) |
void |
setTextContent(String textContent) |
void |
setType(int nodeType) |
void |
setXMLEncoding(String encoding)
Set the charset encoding for the XML declaration of this document.
|
void |
setXmlStandalone(boolean standalone) |
void |
setXmlVersion(String version) |
void |
setXMLVersion(String version)
Sets the XML version.
|
addChild, buildNext, cloneNode, getBuilder, getChildNodes, getChildren, getChildrenWithLocalName, getChildrenWithName, getChildrenWithNamespaceURI, getFirstChild, getFirstChildWithName, getFirstOMChild, getFirstOMChildIfAvailable, getLastChild, getXMLStreamReader, getXMLStreamReader, getXMLStreamReaderWithoutCaching, hasChildNodes, importNode, insertBefore, removeChild, replaceChild, setFirstChild, setLastChilddetach, discard, getNextOMSiblingIfAvailable, getParentNode, insertSiblingAfter, insertSiblingBeforeappendChild, build, buildWithAttachments, close, compareDocumentPosition, getAttributes, getBaseURI, getFeature, getLength, getLocalName, getNamespaceURI, getNodeValue, getOMFactory, getOwnerDocument, getPrefix, getUserData, hasAttributes, internalSerialize, internalSerializeAndConsume, isComplete, isDefaultNamespace, isEqualNode, isSameNode, isSupported, item, lookupNamespaceURI, lookupPrefix, normalize, serialize, serialize, serialize, serialize, serialize, serializeAndConsume, serializeAndConsume, serializeAndConsume, serializeAndConsume, setComplete, setNodeValue, setOwnerDocument, setPrefix, setUserDataclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitappendChild, cloneNode, compareDocumentPosition, getAttributes, getBaseURI, getChildNodes, getFeature, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getUserData, hasAttributes, hasChildNodes, insertBefore, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, removeChild, replaceChild, setNodeValue, setPrefix, setUserDataaddChild, buildNext, getBuilder, getChildren, getChildrenWithLocalName, getChildrenWithName, getChildrenWithNamespaceURI, getFirstChildWithName, getFirstOMChild, getXMLStreamReader, getXMLStreamReader, getXMLStreamReaderWithoutCaching, serialize, serialize, serialize, serializeAndConsume, serializeAndConsume, serializeAndConsumebuild, close, getOMFactory, isComplete, serialize, serialize, serializeAndConsumesetCompleteprotected ElementImpl documentElement
protected Hashtable identifiers
public DocumentImpl(DocumentImpl ownerDocument, OMFactory factory)
ownerDocument - public DocumentImpl(OMXMLParserWrapper parserWrapper, OMFactory factory)
public DocumentImpl(OMFactory factory)
public void setType(int nodeType)
throws OMException
setType in interface OMNodeExOMExceptionpublic int getType()
throws OMException
OMNodegetType in interface OMNodeOMNode.ELEMENT_NODE, OMNode.TEXT_NODE, OMNode.CDATA_SECTION_NODE,
OMNode.COMMENT_NODE, OMNode.DTD_NODE, OMNode.PI_NODE, OMNode.ENTITY_REFERENCE_NODE or OMNode.SPACE_NODE.OMExceptionpublic void internalSerialize(XMLStreamWriter writer, boolean cache) throws XMLStreamException
OMNodeExOMSerializable.serialize(XMLStreamWriter, boolean) instead.internalSerialize in interface OMNodeExcache - indicates if caching should be enabledXMLStreamExceptionpublic OMNode getNextOMSibling() throws OMException
NodeImplgetNextOMSibling in interface OMNodegetNextOMSibling in class ChildNodeOMExceptionpublic Node getNextSibling()
NodeImplgetNextSibling in interface NodegetNextSibling in class ChildNodepublic OMContainer getParent() throws OMException
OMNodeOMDocument or OMElement.getParent in interface OMNodegetParent in class ChildNodeOMContainer of the node.OMExceptionpublic OMNode getPreviousOMSibling()
NodeImplgetPreviousOMSibling in interface OMNodegetPreviousOMSibling in class ChildNodepublic Node getPreviousSibling()
NodeImplgetPreviousSibling in interface NodegetPreviousSibling in class ChildNodepublic void setNextOMSibling(OMNode node)
setNextOMSibling in interface OMNodeExsetNextOMSibling in class ChildNodepublic void setParent(OMContainer element)
public void setPreviousOMSibling(OMNode node)
setPreviousOMSibling in interface OMNodeExsetPreviousOMSibling in class ChildNodepublic String getNodeName()
getNodeName in interface Nodepublic short getNodeType()
getNodeType in interface Nodepublic Attr createAttribute(String name) throws DOMException
createAttribute in interface DocumentDOMExceptionpublic Attr createAttributeNS(String namespaceURI, String qualifiedName) throws DOMException
createAttributeNS in interface DocumentDOMExceptionpublic CDATASection createCDATASection(String arg0) throws DOMException
createCDATASection in interface DocumentDOMExceptionpublic Comment createComment(String data)
createComment in interface Documentpublic DocumentFragment createDocumentFragment()
createDocumentFragment in interface Documentpublic Element createElement(String tagName) throws DOMException
createElement in interface DocumentDOMExceptionpublic Element createElementNS(String ns, String qualifiedName) throws DOMException
createElementNS in interface DocumentDOMExceptionpublic EntityReference createEntityReference(String arg0) throws DOMException
createEntityReference in interface DocumentDOMExceptionpublic ProcessingInstruction createProcessingInstruction(String target, String data) throws DOMException
createProcessingInstruction in interface DocumentDOMExceptionpublic Text createTextNode(String value)
createTextNode in interface Documentpublic DocumentType getDoctype()
getDoctype in interface Documentpublic Element getElementById(String elementId)
getElementById in interface Documentpublic NodeList getElementsByTagName(String arg0)
getElementsByTagName in interface Documentpublic NodeList getElementsByTagNameNS(String arg0, String arg1)
getElementsByTagNameNS in interface Documentpublic DOMImplementation getImplementation()
getImplementation in interface Documentpublic Node importNode(Node importedNode, boolean deep) throws DOMException
importNode in interface DocumentDOMExceptionpublic String getCharsetEncoding()
OMDocumentnull when it is not known, such as
when the document was created in memory or from a character stream.getCharsetEncoding in interface OMDocumentnull if the encoding is not
knownpublic String getXMLVersion()
OMDocumentgetXMLVersion in interface OMDocumentpublic String isStandalone()
OMDocumentisStandalone in interface OMDocumentpublic void setCharsetEncoding(String charsetEncoding)
OMDocumentsetCharsetEncoding in interface OMDocumentpublic void setOMDocumentElement(OMElement rootElement)
OMDocumentsetOMDocumentElement in interface OMDocumentpublic void setStandalone(String isStandalone)
setStandalone in interface OMDocumentpublic void serializeAndConsume(OutputStream output, OMOutputFormat format) throws XMLStreamException
OMContainerserializeAndConsume in interface OMContainerserializeAndConsume in interface OMNodeserializeAndConsume in class NodeImplXMLStreamExceptionpublic void serialize(OutputStream output, OMOutputFormat format) throws XMLStreamException
OMContainerserialize in interface OMContainerserialize in interface OMNodeserialize in class NodeImplXMLStreamExceptionpublic void setXMLVersion(String version)
OMDocumentsetXMLVersion in interface OMDocumentXML 1.0,
XML 1.1public String getXMLEncoding()
OMDocumentgetXMLEncoding in interface OMDocumentnull if the
document didn't have an XML declaration or if the encoding attribute was
not specified in the XML declarationpublic void setXMLEncoding(String encoding)
OMDocumentsetXMLEncoding in interface OMDocumentencoding - the value of the encoding attribute of the XML declarationpublic OMElement getOMDocumentElement()
getOMDocumentElement in interface OMDocumentOMDocument.getOMDocumentElement()public Element getDocumentElement()
getDocumentElement in interface DocumentDocument.getDocumentElement()protected final void checkQName(String prefix, String local)
prefix - prefix of qualified namelocal - local part of qualified nameprotected void addIdAttr(Attr attr)
protected void removeIdAttr(Attr attr)
public String getTextContent() throws DOMException
getTextContent in interface NodegetTextContent in class ParentNodeDOMExceptionpublic void setTextContent(String textContent) throws DOMException
setTextContent in interface NodesetTextContent in class ParentNodeDOMExceptionpublic Node adoptNode(Node node) throws DOMException
adoptNode in interface DocumentDOMExceptionpublic String getDocumentURI()
getDocumentURI in interface Documentpublic DOMConfiguration getDomConfig()
getDomConfig in interface Documentpublic String getInputEncoding()
getInputEncoding in interface Documentpublic boolean getStrictErrorChecking()
getStrictErrorChecking in interface Documentpublic String getXmlEncoding()
getXmlEncoding in interface Documentpublic boolean getXmlStandalone()
getXmlStandalone in interface Documentpublic String getXmlVersion()
getXmlVersion in interface Documentpublic void normalizeDocument()
normalizeDocument in interface Documentpublic Node renameNode(Node arg0, String arg1, String arg2) throws DOMException
renameNode in interface DocumentDOMExceptionpublic void setDocumentURI(String arg0)
setDocumentURI in interface Documentpublic void setStrictErrorChecking(boolean arg0)
setStrictErrorChecking in interface Documentpublic void setXmlStandalone(boolean standalone)
throws DOMException
setXmlStandalone in interface DocumentDOMExceptionpublic void setXmlVersion(String version) throws DOMException
setXmlVersion in interface DocumentDOMExceptionprotected void internalSerialize(XMLStreamWriter writer, boolean cache, boolean includeXMLDeclaration) throws XMLStreamException
XMLStreamExceptionCopyright © 2004–2016 The Apache Software Foundation. All rights reserved.