org.apache.axiom.om.impl.dom
Class DocumentImpl

java.lang.Object
  extended by org.apache.axiom.om.impl.dom.NodeImpl
      extended by org.apache.axiom.om.impl.dom.ChildNode
          extended by org.apache.axiom.om.impl.dom.ParentNode
              extended by org.apache.axiom.om.impl.dom.DocumentImpl
All Implemented Interfaces:
java.lang.Cloneable, OMContainerEx, OMContainer, OMDocument, OMInformationItem, OMSerializable, org.w3c.dom.Document, org.w3c.dom.Node, org.w3c.dom.NodeList
Direct Known Subclasses:
SOAPMessageImpl

public class DocumentImpl
extends ParentNode
implements org.w3c.dom.Document, OMDocument


Field Summary
protected  java.util.Hashtable identifiers
           
 
Fields inherited from class org.apache.axiom.om.impl.dom.ParentNode
firstChild, lastChild
 
Fields inherited from class org.apache.axiom.om.impl.dom.ChildNode
nextSibling, previousSibling
 
Fields inherited from class org.apache.axiom.om.impl.dom.NodeImpl
builder, done, factory, FIRSTCHILD, flags, HAS_PARENT, SPECIFIED
 
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
 
Fields inherited from interface org.apache.axiom.om.OMDocument
XML_10, XML_11
 
Constructor Summary
DocumentImpl(DocumentImpl ownerDocument, OMFactory factory)
           
DocumentImpl(OMFactory factory)
           
DocumentImpl(OMXMLParserWrapper parserWrapper, OMFactory factory)
           
 
Method Summary
protected  void addIdAttr(org.w3c.dom.Attr attr)
           
 org.w3c.dom.Node adoptNode(org.w3c.dom.Node node)
           
protected  void checkQName(java.lang.String prefix, java.lang.String local)
          Borrowed from the Xerces impl.
protected  java.lang.Object clone()
           
 org.w3c.dom.Attr createAttribute(java.lang.String name)
           
 org.w3c.dom.Attr createAttributeNS(java.lang.String namespaceURI, java.lang.String qualifiedName)
           
 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 tagName)
           
 org.w3c.dom.Element createElementNS(java.lang.String ns, java.lang.String qualifiedName)
           
 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 value)
           
 java.lang.String getCharsetEncoding()
           
 org.w3c.dom.DocumentType getDoctype()
           
 org.w3c.dom.Element getDocumentElement()
          Returns the document element.
 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 tagname)
           
 org.w3c.dom.NodeList getElementsByTagNameNS(java.lang.String namespaceURI, java.lang.String localName)
           
 org.w3c.dom.DOMImplementation getImplementation()
           
 java.lang.String getInputEncoding()
           
 OMNode getNextOMSibling()
           
 org.w3c.dom.Node getNextSibling()
          Returns the next child of this node's parent, or null if none.
 java.lang.String getNodeName()
           
 short getNodeType()
           
 OMElement getOMDocumentElement()
           
 org.w3c.dom.Document getOwnerDocument()
           
 OMContainer getParent()
           
 OMNode getPreviousOMSibling()
           
 org.w3c.dom.Node getPreviousSibling()
          Returns the previous child of this node's parent, or null if none.
 boolean getStrictErrorChecking()
           
 java.lang.String getTextContent()
           
 int getType()
           
 java.lang.String getXmlEncoding()
           
 java.lang.String getXMLEncoding()
           
 boolean getXmlStandalone()
           
 java.lang.String getXmlVersion()
           
 java.lang.String getXMLVersion()
           
 org.w3c.dom.Node importNode(org.w3c.dom.Node importedNode, boolean deep)
           
 void internalSerialize(javax.xml.stream.XMLStreamWriter writer, boolean cache)
           
protected  void internalSerialize(javax.xml.stream.XMLStreamWriter writer, boolean cache, boolean includeXMLDeclaration)
           
 java.lang.String isStandalone()
           
 void normalizeDocument()
           
protected  void removeIdAttr(org.w3c.dom.Attr attr)
           
 org.w3c.dom.Node renameNode(org.w3c.dom.Node node, java.lang.String namespaceURI, java.lang.String qualifiedName)
           
 void serialize(java.io.OutputStream output, OMOutputFormat format)
           
 void serializeAndConsume(java.io.OutputStream output, OMOutputFormat format)
           
 void setCharsetEncoding(java.lang.String charsetEncoding)
           
 void setDocumentURI(java.lang.String documentURI)
           
 void setNextOMSibling(OMNode node)
           
 void setOMDocumentElement(OMElement documentElement)
           
 void setParent(OMContainer element)
           
 void setPreviousOMSibling(OMNode node)
           
 void setStandalone(java.lang.String isStandalone)
           
 void setStrictErrorChecking(boolean strictErrorChecking)
           
 void setTextContent(java.lang.String textContent)
           
 void setType(int nodeType)
           
 void setXMLEncoding(java.lang.String encoding)
           
 void setXmlStandalone(boolean standalone)
           
 void setXmlVersion(java.lang.String version)
           
 void setXMLVersion(java.lang.String version)
           
 
Methods inherited from class org.apache.axiom.om.impl.dom.ParentNode
addChild, buildNext, cloneNode, getBuilder, getChildNodes, getChildren, getChildrenWithLocalName, getChildrenWithName, getChildrenWithNamespaceURI, getDescendants, getFirstChild, getFirstChildWithName, getFirstOMChild, getFirstOMChildIfAvailable, getLastChild, getSAXSource, getXMLStreamReader, getXMLStreamReader, getXMLStreamReader, getXMLStreamReaderWithoutCaching, hasChildNodes, importNode, insertBefore, removeChild, replaceChild, setFirstChild, setLastChild
 
Methods inherited from class org.apache.axiom.om.impl.dom.ChildNode
build, buildWithAttachments, close, detach, discard, getNextOMSiblingIfAvailable, getParentNode, insertSiblingAfter, insertSiblingBefore, internalSerialize, internalSerializeAndConsume, isComplete, serialize, serialize, serialize, serialize, serialize, serializeAndConsume, serializeAndConsume, serializeAndConsume, serializeAndConsume, setComplete
 
Methods inherited from class org.apache.axiom.om.impl.dom.NodeImpl
appendChild, compareDocumentPosition, getAttributes, getBaseURI, getFeature, getLength, getLocalName, getNamespaceURI, getNodeValue, getOMFactory, getPrefix, getUserData, hasAttributes, isDefaultNamespace, isEqualNode, isSameNode, isSupported, item, lookupNamespaceURI, lookupPrefix, normalize, setNodeValue, setPrefix, setUserData
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.w3c.dom.Node
appendChild, cloneNode, compareDocumentPosition, getAttributes, getBaseURI, getChildNodes, getFeature, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNodeValue, getParentNode, getPrefix, getUserData, hasAttributes, hasChildNodes, insertBefore, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, removeChild, replaceChild, setNodeValue, setPrefix, setUserData
 
Methods inherited from interface org.apache.axiom.om.OMContainer
addChild, buildNext, getBuilder, getChildren, getChildrenWithLocalName, getChildrenWithName, getChildrenWithNamespaceURI, getDescendants, getFirstChildWithName, getFirstOMChild, getSAXSource, getXMLStreamReader, getXMLStreamReader, getXMLStreamReader, getXMLStreamReaderWithoutCaching, serialize, serialize, serialize, serializeAndConsume, serializeAndConsume, serializeAndConsume
 
Methods inherited from interface org.apache.axiom.om.OMSerializable
build, close, isComplete, serialize, serialize, serializeAndConsume
 
Methods inherited from interface org.apache.axiom.om.OMInformationItem
getOMFactory
 
Methods inherited from interface org.apache.axiom.om.impl.OMContainerEx
setComplete
 

Field Detail

identifiers

protected java.util.Hashtable identifiers
Constructor Detail

DocumentImpl

public DocumentImpl(DocumentImpl ownerDocument,
                    OMFactory factory)
Parameters:
ownerDocument -

DocumentImpl

public DocumentImpl(OMXMLParserWrapper parserWrapper,
                    OMFactory factory)

DocumentImpl

public DocumentImpl(OMFactory factory)
Method Detail

getOwnerDocument

public org.w3c.dom.Document getOwnerDocument()
Specified by:
getOwnerDocument in interface org.w3c.dom.Node
Overrides:
getOwnerDocument in class ChildNode

clone

protected java.lang.Object clone()
                          throws java.lang.CloneNotSupportedException
Overrides:
clone in class java.lang.Object
Throws:
java.lang.CloneNotSupportedException

setType

public void setType(int nodeType)
             throws OMException
Throws:
OMException

getType

public int getType()
            throws OMException
Throws:
OMException

internalSerialize

public void internalSerialize(javax.xml.stream.XMLStreamWriter writer,
                              boolean cache)
                       throws javax.xml.stream.XMLStreamException
Specified by:
internalSerialize in class ChildNode
Throws:
javax.xml.stream.XMLStreamException

getNextOMSibling

public OMNode getNextOMSibling()
                        throws OMException
Overrides:
getNextOMSibling in class ChildNode
Throws:
OMException

getNextSibling

public org.w3c.dom.Node getNextSibling()
Description copied from class: NodeImpl
Returns the next child of this node's parent, or null if none.

Specified by:
getNextSibling in interface org.w3c.dom.Node
Overrides:
getNextSibling in class ChildNode

getParent

public OMContainer getParent()
                      throws OMException
Overrides:
getParent in class ChildNode
Throws:
OMException

getPreviousOMSibling

public OMNode getPreviousOMSibling()
Overrides:
getPreviousOMSibling in class ChildNode

getPreviousSibling

public org.w3c.dom.Node getPreviousSibling()
Description copied from class: NodeImpl
Returns the previous child of this node's parent, or null if none.

Specified by:
getPreviousSibling in interface org.w3c.dom.Node
Overrides:
getPreviousSibling in class ChildNode

setNextOMSibling

public void setNextOMSibling(OMNode node)
Overrides:
setNextOMSibling in class ChildNode

setParent

public void setParent(OMContainer element)
Overrides:
setParent in class ChildNode

setPreviousOMSibling

public void setPreviousOMSibling(OMNode node)
Overrides:
setPreviousOMSibling in class ChildNode

getNodeName

public java.lang.String getNodeName()
Specified by:
getNodeName in interface org.w3c.dom.Node

getNodeType

public short getNodeType()
Specified by:
getNodeType in interface org.w3c.dom.Node

createAttribute

public org.w3c.dom.Attr createAttribute(java.lang.String name)
                                 throws org.w3c.dom.DOMException
Specified by:
createAttribute in interface org.w3c.dom.Document
Throws:
org.w3c.dom.DOMException

createAttributeNS

public org.w3c.dom.Attr createAttributeNS(java.lang.String namespaceURI,
                                          java.lang.String qualifiedName)
                                   throws org.w3c.dom.DOMException
Specified by:
createAttributeNS in interface org.w3c.dom.Document
Throws:
org.w3c.dom.DOMException

createCDATASection

public org.w3c.dom.CDATASection createCDATASection(java.lang.String data)
                                            throws org.w3c.dom.DOMException
Specified by:
createCDATASection in interface org.w3c.dom.Document
Throws:
org.w3c.dom.DOMException

createComment

public org.w3c.dom.Comment createComment(java.lang.String data)
Specified by:
createComment in interface org.w3c.dom.Document

createDocumentFragment

public org.w3c.dom.DocumentFragment createDocumentFragment()
Specified by:
createDocumentFragment in interface org.w3c.dom.Document

createElement

public org.w3c.dom.Element createElement(java.lang.String tagName)
                                  throws org.w3c.dom.DOMException
Specified by:
createElement in interface org.w3c.dom.Document
Throws:
org.w3c.dom.DOMException

createElementNS

public org.w3c.dom.Element createElementNS(java.lang.String ns,
                                           java.lang.String qualifiedName)
                                    throws org.w3c.dom.DOMException
Specified by:
createElementNS in interface org.w3c.dom.Document
Throws:
org.w3c.dom.DOMException

createEntityReference

public org.w3c.dom.EntityReference createEntityReference(java.lang.String name)
                                                  throws org.w3c.dom.DOMException
Specified by:
createEntityReference in interface org.w3c.dom.Document
Throws:
org.w3c.dom.DOMException

createProcessingInstruction

public org.w3c.dom.ProcessingInstruction createProcessingInstruction(java.lang.String target,
                                                                     java.lang.String data)
                                                              throws org.w3c.dom.DOMException
Specified by:
createProcessingInstruction in interface org.w3c.dom.Document
Throws:
org.w3c.dom.DOMException

createTextNode

public org.w3c.dom.Text createTextNode(java.lang.String value)
Specified by:
createTextNode in interface org.w3c.dom.Document

getDoctype

public org.w3c.dom.DocumentType getDoctype()
Specified by:
getDoctype in interface org.w3c.dom.Document

getElementById

public org.w3c.dom.Element getElementById(java.lang.String elementId)
Specified by:
getElementById in interface org.w3c.dom.Document

getElementsByTagName

public org.w3c.dom.NodeList getElementsByTagName(java.lang.String tagname)
Specified by:
getElementsByTagName in interface org.w3c.dom.Document

getElementsByTagNameNS

public org.w3c.dom.NodeList getElementsByTagNameNS(java.lang.String namespaceURI,
                                                   java.lang.String localName)
Specified by:
getElementsByTagNameNS in interface org.w3c.dom.Document

getImplementation

public org.w3c.dom.DOMImplementation getImplementation()
Specified by:
getImplementation in interface org.w3c.dom.Document

importNode

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

getCharsetEncoding

public java.lang.String getCharsetEncoding()
Specified by:
getCharsetEncoding in interface OMDocument

getXMLVersion

public java.lang.String getXMLVersion()
Specified by:
getXMLVersion in interface OMDocument

isStandalone

public java.lang.String isStandalone()
Specified by:
isStandalone in interface OMDocument

setCharsetEncoding

public void setCharsetEncoding(java.lang.String charsetEncoding)
Specified by:
setCharsetEncoding in interface OMDocument

setOMDocumentElement

public void setOMDocumentElement(OMElement documentElement)
Specified by:
setOMDocumentElement in interface OMDocument

setStandalone

public void setStandalone(java.lang.String isStandalone)
Specified by:
setStandalone in interface OMDocument

serializeAndConsume

public void serializeAndConsume(java.io.OutputStream output,
                                OMOutputFormat format)
                         throws javax.xml.stream.XMLStreamException
Specified by:
serializeAndConsume in interface OMContainer
Overrides:
serializeAndConsume in class ChildNode
Throws:
javax.xml.stream.XMLStreamException

serialize

public void serialize(java.io.OutputStream output,
                      OMOutputFormat format)
               throws javax.xml.stream.XMLStreamException
Specified by:
serialize in interface OMContainer
Overrides:
serialize in class ChildNode
Throws:
javax.xml.stream.XMLStreamException

setXMLVersion

public void setXMLVersion(java.lang.String version)
Specified by:
setXMLVersion in interface OMDocument

getXMLEncoding

public java.lang.String getXMLEncoding()
Specified by:
getXMLEncoding in interface OMDocument

setXMLEncoding

public void setXMLEncoding(java.lang.String encoding)
Specified by:
setXMLEncoding in interface OMDocument

getOMDocumentElement

public OMElement getOMDocumentElement()
Specified by:
getOMDocumentElement in interface OMDocument

getDocumentElement

public org.w3c.dom.Element getDocumentElement()
Returns the document element.

Specified by:
getDocumentElement in interface org.w3c.dom.Document
See Also:
Document.getDocumentElement()

checkQName

protected final void checkQName(java.lang.String prefix,
                                java.lang.String local)
Borrowed from the Xerces impl. Checks if the given qualified name is legal with respect to the version of XML to which this document must conform.

Parameters:
prefix - prefix of qualified name
local - local part of qualified name

addIdAttr

protected void addIdAttr(org.w3c.dom.Attr attr)

removeIdAttr

protected void removeIdAttr(org.w3c.dom.Attr attr)

getTextContent

public java.lang.String getTextContent()
                                throws org.w3c.dom.DOMException
Specified by:
getTextContent in interface org.w3c.dom.Node
Overrides:
getTextContent in class ParentNode
Throws:
org.w3c.dom.DOMException

setTextContent

public void setTextContent(java.lang.String textContent)
                    throws org.w3c.dom.DOMException
Specified by:
setTextContent in interface org.w3c.dom.Node
Overrides:
setTextContent in class ParentNode
Throws:
org.w3c.dom.DOMException

adoptNode

public org.w3c.dom.Node adoptNode(org.w3c.dom.Node node)
                           throws org.w3c.dom.DOMException
Specified by:
adoptNode in interface org.w3c.dom.Document
Throws:
org.w3c.dom.DOMException

getDocumentURI

public java.lang.String getDocumentURI()
Specified by:
getDocumentURI in interface org.w3c.dom.Document

getDomConfig

public org.w3c.dom.DOMConfiguration getDomConfig()
Specified by:
getDomConfig in interface org.w3c.dom.Document

getInputEncoding

public java.lang.String getInputEncoding()
Specified by:
getInputEncoding in interface org.w3c.dom.Document

getStrictErrorChecking

public boolean getStrictErrorChecking()
Specified by:
getStrictErrorChecking in interface org.w3c.dom.Document

getXmlEncoding

public java.lang.String getXmlEncoding()
Specified by:
getXmlEncoding in interface org.w3c.dom.Document

getXmlStandalone

public boolean getXmlStandalone()
Specified by:
getXmlStandalone in interface org.w3c.dom.Document

getXmlVersion

public java.lang.String getXmlVersion()
Specified by:
getXmlVersion in interface org.w3c.dom.Document

normalizeDocument

public void normalizeDocument()
Specified by:
normalizeDocument in interface org.w3c.dom.Document

renameNode

public org.w3c.dom.Node renameNode(org.w3c.dom.Node node,
                                   java.lang.String namespaceURI,
                                   java.lang.String qualifiedName)
                            throws org.w3c.dom.DOMException
Specified by:
renameNode in interface org.w3c.dom.Document
Throws:
org.w3c.dom.DOMException

setDocumentURI

public void setDocumentURI(java.lang.String documentURI)
Specified by:
setDocumentURI in interface org.w3c.dom.Document

setStrictErrorChecking

public void setStrictErrorChecking(boolean strictErrorChecking)
Specified by:
setStrictErrorChecking in interface org.w3c.dom.Document

setXmlStandalone

public void setXmlStandalone(boolean standalone)
                      throws org.w3c.dom.DOMException
Specified by:
setXmlStandalone in interface org.w3c.dom.Document
Throws:
org.w3c.dom.DOMException

setXmlVersion

public void setXmlVersion(java.lang.String version)
                   throws org.w3c.dom.DOMException
Specified by:
setXmlVersion in interface org.w3c.dom.Document
Throws:
org.w3c.dom.DOMException

internalSerialize

protected void internalSerialize(javax.xml.stream.XMLStreamWriter writer,
                                 boolean cache,
                                 boolean includeXMLDeclaration)
                          throws javax.xml.stream.XMLStreamException
Throws:
javax.xml.stream.XMLStreamException


Copyright © 2004-2012 The Apache Software Foundation. All Rights Reserved.