com.caucho.xml
Class QDocument

java.lang.Object
  extended by com.caucho.xml.QAbstractNode
      extended by com.caucho.xml.QNode
          extended by com.caucho.xml.QDocumentFragment
              extended by com.caucho.xml.QDocument
All Implemented Interfaces:
CauchoDocument, CauchoNode, java.io.Serializable, org.w3c.dom.Document, org.w3c.dom.DocumentFragment, org.w3c.dom.Node

public class QDocument
extends QDocumentFragment
implements CauchoDocument

Implements the top-level document for the XML tree.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class com.caucho.xml.QNode
QNode.ChildNodeList
 
Field Summary
 
Fields inherited from class com.caucho.xml.QDocumentFragment
_masterDoc
 
Fields inherited from class com.caucho.xml.QNode
_firstChild, _lastChild
 
Fields inherited from class com.caucho.xml.QAbstractNode
L
 
Fields inherited from interface com.caucho.xml.CauchoDocument
DEPENDS
 
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
QDocument()
           
QDocument(org.w3c.dom.DocumentType docType)
           
QDocument(QDOMImplementation impl)
           
 
Method Summary
 void addDepend(Path path)
           
 void addNamespace(QName qname)
           
 void addNamespace(java.lang.String prefix, java.lang.String url)
          Add a namespace declaration to a document.
 org.w3c.dom.Node adoptNode(org.w3c.dom.Node source)
           
 org.w3c.dom.Node appendChild(org.w3c.dom.Node newChild)
           
 boolean canSetNormalizationFeature(java.lang.String name, boolean state)
           
 org.w3c.dom.Node cloneNode(boolean deep)
          Returns a clone of the document.
protected  org.w3c.dom.Node copyNode(QDocument newNode, boolean deep)
           
static org.w3c.dom.Document create()
           
 org.w3c.dom.Attr createAttribute(QName name, java.lang.String value)
          Creates a new namespace-aware attribute
 org.w3c.dom.Attr createAttribute(java.lang.String name)
           
 org.w3c.dom.Attr createAttribute(java.lang.String name, java.lang.String value)
           
 org.w3c.dom.Attr createAttribute(java.lang.String prefix, java.lang.String local, java.lang.String url)
          Creates a new namespace-aware attribute
 org.w3c.dom.Attr createAttributeNS(java.lang.String namespaceURI, java.lang.String qualifiedName)
          Creates a new namespace-aware attribute
 org.w3c.dom.CDATASection createCDATASection(java.lang.String data)
           
 org.w3c.dom.Comment createComment(java.lang.String data)
           
 org.w3c.dom.DocumentFragment createDocumentFragment()
          Creates a new document fragment.
 org.w3c.dom.Element createElement(java.lang.String tagName)
          Creates a new element
 org.w3c.dom.Element createElement(java.lang.String prefix, java.lang.String local, java.lang.String url)
          Creates a new namespace-aware element
 org.w3c.dom.Element createElementByName(QName name)
           
 org.w3c.dom.Element createElementNS(java.lang.String namespaceURI, java.lang.String name)
          Creates a new namespace-aware element
 org.w3c.dom.EntityReference createEntityReference(java.lang.String name)
           
 QName createName(java.lang.String uri, 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)
          Creates a new text node in this document.
 org.w3c.dom.Text createUnescapedTextNode(java.lang.String data)
           
 java.lang.String getActualEncoding()
           
 java.lang.String getBaseURI()
          Returns the base URI of the node.
 java.util.ArrayList<Depend> getDependencyList()
           
 java.util.ArrayList<Path> getDependList()
           
 org.w3c.dom.DocumentType getDoctype()
           
 org.w3c.dom.Element getDocumentElement()
           
 java.lang.String getDocumentURI()
           
 org.w3c.dom.DOMConfiguration getDomConfig()
           
 org.w3c.dom.Element getElementById(java.lang.String name)
           
 org.w3c.dom.NodeList getElementsByTagName(java.lang.String name)
          Returns a list of elements, filtered by the tag name.
 org.w3c.dom.NodeList getElementsByTagNameNS(java.lang.String uri, java.lang.String name)
           
 java.lang.String getEncoding()
           
 org.w3c.dom.DOMErrorHandler getErrorHandler()
           
 org.w3c.dom.DOMImplementation getImplementation()
           
 java.lang.String getInputEncoding()
           
 java.lang.String getNamespace(java.lang.String prefix)
          Returns the namespace url for a given prefix.
 java.util.Iterator<java.lang.String> getNamespaceKeys()
          Returns an iterator of top-level namespace prefixes.
 java.util.HashMap<java.lang.String,java.lang.String> getNamespaces()
           
 java.lang.String getNodeName()
          The node name for the document is #document.
 short getNodeType()
           
 boolean getNormalizationFeature(java.lang.String name)
           
 org.w3c.dom.Document getOwnerDocument()
          Returns the owning document.
 java.lang.Object getProperty(java.lang.String name)
           
 java.lang.String getRootFilename()
           
 org.w3c.dom.TypeInfo getSchemaTypeInfo()
           
 boolean getStandalone()
           
 boolean getStrictErrorChecking()
           
 java.lang.String getSystemId()
           
 java.lang.String getXmlEncoding()
           
 boolean getXmlStandalone()
           
 java.lang.String getXmlVersion()
           
 org.w3c.dom.Node importNode(org.w3c.dom.Node node, boolean deep)
          Imports a copy of a node into the current document.
 boolean isModified()
           
 boolean isSupported(java.lang.String feature, java.lang.String version)
           
 void normalizeDocument()
           
 org.w3c.dom.Node removeChild(org.w3c.dom.Node oldChild)
           
 org.w3c.dom.Node renameNode(org.w3c.dom.Node n, java.lang.String namespaceURI, java.lang.String name)
           
 void setActualEncoding(java.lang.String actualEncoding)
           
 void setDoctype(org.w3c.dom.DocumentType dtd)
           
 void setDocumentElement(org.w3c.dom.Element elt)
           
 void setDocumentURI(java.lang.String documentURI)
           
 void setEncoding(java.lang.String encoding)
           
 void setErrorHandler(org.w3c.dom.DOMErrorHandler errorHandler)
           
 void setNormalizationFeature(java.lang.String name, boolean state)
           
 void setProperty(java.lang.String name, java.lang.Object value)
           
 void setRootFilename(java.lang.String filename)
           
 void setStandalone(boolean standalone)
           
 void setStrictErrorChecking(boolean strictErrorChecking)
           
 void setSystemId(java.lang.String systemId)
           
 void setXmlStandalone(boolean value)
           
 void setXmlVersion(java.lang.String version)
           
 java.lang.String toString()
           
 void validateName(QName qname)
           
 
Methods inherited from class com.caucho.xml.QDocumentFragment
getMasterDoc, getTextValue
 
Methods inherited from class com.caucho.xml.QNode
checkValid, equals, equals, getAttributes, getChildNodes, getFirstChild, getLastChild, getNextPreorder, getNextSibling, getNodeValue, getPreviousSibling, hasChildNodes, insertBefore, normalize, replaceChild, setNodeValue, setTextContent
 
Methods inherited from class com.caucho.xml.QAbstractNode
baseURI, compareDocumentPosition, compareTreePosition, getCanonicalName, getColumn, getFeature, getFilename, getInterface, getLine, getLocalName, getNamespaceURI, getNextContent, getParentNode, getPrefix, getPreviousContent, getQName, getTextContent, getUserData, hasAttributes, hasContent, isDefaultNamespace, isEqualNode, isSameNode, lookupNamespacePrefix, lookupNamespaceURI, lookupPrefix, print, printHtml, printPretty, setFeature, setLocation, setPrefix, setUserData, supports
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.caucho.xml.CauchoNode
checkValid, getCanonicalName, getColumn, getFilename, getLine, getLocalName, getNamespaceURI, getPrefix, getTextValue, print, printHtml, printPretty, setLocation
 
Methods inherited from interface org.w3c.dom.Node
compareDocumentPosition, getAttributes, getChildNodes, getFeature, getFirstChild, getLastChild, getNextSibling, getNodeValue, getParentNode, getPreviousSibling, getTextContent, getUserData, hasAttributes, hasChildNodes, insertBefore, isDefaultNamespace, isEqualNode, isSameNode, lookupNamespaceURI, lookupPrefix, normalize, replaceChild, setNodeValue, setPrefix, setTextContent, setUserData
 

Constructor Detail

QDocument

public QDocument()

QDocument

public QDocument(org.w3c.dom.DocumentType docType)

QDocument

public QDocument(QDOMImplementation impl)
Method Detail

getRootFilename

public java.lang.String getRootFilename()

setRootFilename

public void setRootFilename(java.lang.String filename)

setSystemId

public void setSystemId(java.lang.String systemId)

getSystemId

public java.lang.String getSystemId()

getBaseURI

public java.lang.String getBaseURI()
Returns the base URI of the node.

Specified by:
getBaseURI in interface CauchoNode
Specified by:
getBaseURI in interface org.w3c.dom.Node
Overrides:
getBaseURI in class QAbstractNode

getOwnerDocument

public org.w3c.dom.Document getOwnerDocument()
Description copied from class: QAbstractNode
Returns the owning document.

Specified by:
getOwnerDocument in interface org.w3c.dom.Node
Overrides:
getOwnerDocument in class QAbstractNode

getDomConfig

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

isSupported

public boolean isSupported(java.lang.String feature,
                           java.lang.String version)
Specified by:
isSupported in interface org.w3c.dom.Node
Overrides:
isSupported in class QAbstractNode

getNodeName

public java.lang.String getNodeName()
The node name for the document is #document.

Specified by:
getNodeName in interface org.w3c.dom.Node
Overrides:
getNodeName in class QDocumentFragment

getNodeType

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

copyNode

protected org.w3c.dom.Node copyNode(QDocument newNode,
                                    boolean deep)

cloneNode

public org.w3c.dom.Node cloneNode(boolean deep)
Returns a clone of the document.

Specified by:
cloneNode in interface org.w3c.dom.Node
Overrides:
cloneNode in class QAbstractNode
Parameters:
deep - if true, recursively copy the document.

importNode

public org.w3c.dom.Node importNode(org.w3c.dom.Node node,
                                   boolean deep)
Imports a copy of a node into the current document.

Specified by:
importNode in interface org.w3c.dom.Document
Parameters:
node - the node to import/copy
deep - if true, recursively copy the children.
Returns:
the new imported node.

getDoctype

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

setDoctype

public void setDoctype(org.w3c.dom.DocumentType dtd)

getEncoding

public java.lang.String getEncoding()

getImplementation

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

getDocumentElement

public org.w3c.dom.Element getDocumentElement()
Specified by:
getDocumentElement in interface org.w3c.dom.Document

setDocumentElement

public void setDocumentElement(org.w3c.dom.Element elt)

createElement

public org.w3c.dom.Element createElement(java.lang.String tagName)
                                  throws org.w3c.dom.DOMException
Creates a new element

Specified by:
createElement in interface org.w3c.dom.Document
Throws:
org.w3c.dom.DOMException

createElementNS

public org.w3c.dom.Element createElementNS(java.lang.String namespaceURI,
                                           java.lang.String name)
                                    throws org.w3c.dom.DOMException
Creates a new namespace-aware element

Specified by:
createElementNS in interface org.w3c.dom.Document
Throws:
org.w3c.dom.DOMException

validateName

public void validateName(QName qname)
                  throws org.w3c.dom.DOMException
Throws:
org.w3c.dom.DOMException

createElement

public org.w3c.dom.Element createElement(java.lang.String prefix,
                                         java.lang.String local,
                                         java.lang.String url)
                                  throws org.w3c.dom.DOMException
Creates a new namespace-aware element

Specified by:
createElement in interface CauchoDocument
Throws:
org.w3c.dom.DOMException

createElementByName

public org.w3c.dom.Element createElementByName(QName name)
                                        throws org.w3c.dom.DOMException
Throws:
org.w3c.dom.DOMException

createDocumentFragment

public org.w3c.dom.DocumentFragment createDocumentFragment()
Creates a new document fragment.

Specified by:
createDocumentFragment in interface org.w3c.dom.Document

createTextNode

public org.w3c.dom.Text createTextNode(java.lang.String data)
Creates a new text node in this document.

Specified by:
createTextNode in interface org.w3c.dom.Document

createUnescapedTextNode

public org.w3c.dom.Text createUnescapedTextNode(java.lang.String data)
Specified by:
createUnescapedTextNode in interface CauchoDocument

createComment

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

createCDATASection

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

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

createAttribute

public org.w3c.dom.Attr createAttribute(java.lang.String name,
                                        java.lang.String value)
                                 throws org.w3c.dom.DOMException
Throws:
org.w3c.dom.DOMException

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

createAttribute

public org.w3c.dom.Attr createAttribute(java.lang.String prefix,
                                        java.lang.String local,
                                        java.lang.String url)
                                 throws org.w3c.dom.DOMException
Creates a new namespace-aware attribute

Specified by:
createAttribute in interface CauchoDocument
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
Creates a new namespace-aware attribute

Specified by:
createAttributeNS in interface org.w3c.dom.Document
Throws:
org.w3c.dom.DOMException

createName

public QName createName(java.lang.String uri,
                        java.lang.String name)

createAttribute

public org.w3c.dom.Attr createAttribute(QName name,
                                        java.lang.String value)
                                 throws org.w3c.dom.DOMException
Creates a new namespace-aware attribute

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

getElementsByTagName

public org.w3c.dom.NodeList getElementsByTagName(java.lang.String name)
Returns a list of elements, filtered by the tag name.

Specified by:
getElementsByTagName in interface org.w3c.dom.Document

getElementsByTagNameNS

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

getElementById

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

create

public static org.w3c.dom.Document create()

appendChild

public org.w3c.dom.Node appendChild(org.w3c.dom.Node newChild)
                             throws org.w3c.dom.DOMException
Specified by:
appendChild in interface org.w3c.dom.Node
Overrides:
appendChild in class QNode
Throws:
org.w3c.dom.DOMException

removeChild

public org.w3c.dom.Node removeChild(org.w3c.dom.Node oldChild)
                             throws org.w3c.dom.DOMException
Specified by:
removeChild in interface org.w3c.dom.Node
Overrides:
removeChild in class QNode
Throws:
org.w3c.dom.DOMException

addNamespace

public void addNamespace(QName qname)

addNamespace

public void addNamespace(java.lang.String prefix,
                         java.lang.String url)
Add a namespace declaration to a document. If the declaration prefix already has a namespace, the old one wins.


getNamespaces

public java.util.HashMap<java.lang.String,java.lang.String> getNamespaces()
Specified by:
getNamespaces in interface CauchoDocument

getNamespace

public java.lang.String getNamespace(java.lang.String prefix)
Returns the namespace url for a given prefix.


getNamespaceKeys

public java.util.Iterator<java.lang.String> getNamespaceKeys()
Returns an iterator of top-level namespace prefixes.


getProperty

public java.lang.Object getProperty(java.lang.String name)
Specified by:
getProperty in interface CauchoDocument

getDependList

public java.util.ArrayList<Path> getDependList()

getDependencyList

public java.util.ArrayList<Depend> getDependencyList()
Overrides:
getDependencyList in class QAbstractNode

setProperty

public void setProperty(java.lang.String name,
                        java.lang.Object value)
Specified by:
setProperty in interface CauchoDocument

getActualEncoding

public java.lang.String getActualEncoding()

setActualEncoding

public void setActualEncoding(java.lang.String actualEncoding)

setEncoding

public void setEncoding(java.lang.String encoding)

getStandalone

public boolean getStandalone()

setStandalone

public void setStandalone(boolean standalone)

getXmlVersion

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

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

setXmlStandalone

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

getSchemaTypeInfo

public org.w3c.dom.TypeInfo getSchemaTypeInfo()

getXmlEncoding

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

getInputEncoding

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

getXmlStandalone

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

getStrictErrorChecking

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

setStrictErrorChecking

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

getErrorHandler

public org.w3c.dom.DOMErrorHandler getErrorHandler()

setErrorHandler

public void setErrorHandler(org.w3c.dom.DOMErrorHandler errorHandler)

getDocumentURI

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

setDocumentURI

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

adoptNode

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

normalizeDocument

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

canSetNormalizationFeature

public boolean canSetNormalizationFeature(java.lang.String name,
                                          boolean state)

setNormalizationFeature

public void setNormalizationFeature(java.lang.String name,
                                    boolean state)
                             throws org.w3c.dom.DOMException
Throws:
org.w3c.dom.DOMException

getNormalizationFeature

public boolean getNormalizationFeature(java.lang.String name)
                                throws org.w3c.dom.DOMException
Throws:
org.w3c.dom.DOMException

renameNode

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

addDepend

public void addDepend(Path path)

isModified

public boolean isModified()

toString

public java.lang.String toString()
Overrides:
toString in class QDocumentFragment