com.caucho.xml
Class QAbstractNode

java.lang.Object
  extended by com.caucho.xml.QAbstractNode
All Implemented Interfaces:
CauchoNode, java.io.Serializable, org.w3c.dom.Node
Direct Known Subclasses:
NamespaceNode, QComment, QNode, QText

public abstract class QAbstractNode
extends java.lang.Object
implements CauchoNode, java.io.Serializable

QAbstractNode is an abstract implementation for any DOM node.

See Also:
Serialized Form

Field Summary
protected static L10N L
           
 
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
protected QAbstractNode()
           
protected QAbstractNode(QDocument owner)
           
 
Method Summary
 org.w3c.dom.Node appendChild(org.w3c.dom.Node newNode)
           
static java.lang.String baseURI(org.w3c.dom.Node node)
          Returns the base URI
 boolean checkValid()
          For testing...
 org.w3c.dom.Node cloneNode(boolean deep)
           
 short compareDocumentPosition(org.w3c.dom.Node node)
          Compares the document position
 short compareTreePosition(org.w3c.dom.Node other)
           
 boolean equals(org.w3c.dom.Node arg, boolean deep)
           
 org.w3c.dom.NamedNodeMap getAttributes()
           
 java.lang.String getBaseURI()
          Returns the base URI of the node.
 java.lang.String getCanonicalName()
          Returns the node's canonical name.
 org.w3c.dom.NodeList getChildNodes()
           
 int getColumn()
          Returns the source column of this node.
 java.util.ArrayList<Depend> getDependencyList()
           
 java.lang.Object getFeature(java.lang.String feature, java.lang.String version)
          Returns a feature value.
 java.lang.String getFilename()
          Returns the node's source filename.
 org.w3c.dom.Node getFirstChild()
           
 org.w3c.dom.Node getInterface(java.lang.String feature)
           
 org.w3c.dom.Node getLastChild()
           
 int getLine()
          Returns the node's source line.
 java.lang.String getLocalName()
           
 java.lang.String getNamespaceURI()
           
 QAbstractNode getNextContent()
           
 QAbstractNode getNextPreorder()
           
 org.w3c.dom.Node getNextSibling()
           
 java.lang.String getNodeValue()
           
 org.w3c.dom.Document getOwnerDocument()
          Returns the owning document.
 org.w3c.dom.Node getParentNode()
           
 java.lang.String getPrefix()
           
 QAbstractNode getPreviousContent()
           
 org.w3c.dom.Node getPreviousSibling()
           
 QName getQName()
           
 java.lang.String getTextContent()
           
 java.lang.String getTextValue()
          Returns the text value of the node
 java.lang.Object getUserData(java.lang.String data)
           
 boolean hasAttributes()
          Returns true if the node has attributes.
 boolean hasChildNodes()
           
 boolean hasContent()
           
 org.w3c.dom.Node insertBefore(org.w3c.dom.Node newChild, org.w3c.dom.Node refChild)
           
 boolean isDefaultNamespace(java.lang.String namespaceURI)
           
 boolean isEqualNode(org.w3c.dom.Node arg)
           
 boolean isSameNode(org.w3c.dom.Node other)
           
 boolean isSupported(java.lang.String feature, java.lang.String version)
           
 java.lang.String lookupNamespacePrefix(java.lang.String namespaceURI, boolean useDefault)
           
 java.lang.String lookupNamespaceURI(java.lang.String prefix)
           
 java.lang.String lookupPrefix(java.lang.String feature)
          Looks up a prefix value.
 void normalize()
           
 void print(WriteStream out)
          Prints the node to a stream
 void printHtml(WriteStream out)
          Prints the node as html to a stream
 void printPretty(WriteStream out)
          Pretty-prints the node to a stream
 org.w3c.dom.Node removeChild(org.w3c.dom.Node oldChild)
           
 org.w3c.dom.Node replaceChild(org.w3c.dom.Node newChild, org.w3c.dom.Node refChild)
           
 void setFeature(java.lang.String feature, boolean value)
          Sets a feature value.
 void setLocation(java.lang.String systemId, java.lang.String filename, int line, int column)
          Sets the location
 void setNodeValue(java.lang.String value)
           
 void setPrefix(java.lang.String prefix)
           
 void setTextContent(java.lang.String textContent)
           
 java.lang.Object setUserData(java.lang.String key, java.lang.Object value, org.w3c.dom.UserDataHandler userData)
           
 boolean supports(java.lang.String feature, java.lang.String version)
          Support the same and the implementation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.w3c.dom.Node
getNodeName, getNodeType
 

Field Detail

L

protected static L10N L
Constructor Detail

QAbstractNode

protected QAbstractNode()

QAbstractNode

protected QAbstractNode(QDocument owner)
Method Detail

setLocation

public void setLocation(java.lang.String systemId,
                        java.lang.String filename,
                        int line,
                        int column)
Description copied from interface: CauchoNode
Sets the location

Specified by:
setLocation in interface CauchoNode

getFilename

public java.lang.String getFilename()
Returns the node's source filename.

Specified by:
getFilename in interface CauchoNode

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

baseURI

public static java.lang.String baseURI(org.w3c.dom.Node node)
Returns the base URI


getLine

public int getLine()
Returns the node's source line.

Specified by:
getLine in interface CauchoNode

getColumn

public int getColumn()
Description copied from interface: CauchoNode
Returns the source column of this node. p

Specified by:
getColumn in interface CauchoNode

getOwnerDocument

public org.w3c.dom.Document getOwnerDocument()
Returns the owning document.

Specified by:
getOwnerDocument in interface org.w3c.dom.Node

isSupported

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

getFeature

public java.lang.Object getFeature(java.lang.String feature,
                                   java.lang.String version)
Returns a feature value.

Specified by:
getFeature in interface org.w3c.dom.Node

setFeature

public void setFeature(java.lang.String feature,
                       boolean value)
Sets a feature value.


compareDocumentPosition

public short compareDocumentPosition(org.w3c.dom.Node node)
Compares the document position

Specified by:
compareDocumentPosition in interface org.w3c.dom.Node

lookupPrefix

public java.lang.String lookupPrefix(java.lang.String feature)
Looks up a prefix value.

Specified by:
lookupPrefix in interface org.w3c.dom.Node

hasAttributes

public boolean hasAttributes()
Returns true if the node has attributes.

Specified by:
hasAttributes in interface org.w3c.dom.Node

getPrefix

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

setPrefix

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

setUserData

public java.lang.Object setUserData(java.lang.String key,
                                    java.lang.Object value,
                                    org.w3c.dom.UserDataHandler userData)
Specified by:
setUserData in interface org.w3c.dom.Node

getUserData

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

getCanonicalName

public java.lang.String getCanonicalName()
Description copied from interface: CauchoNode
Returns the node's canonical name.

e.g. for foo:bar:baz, the prefix name might be '{/caucho/1.0}baz'

Specified by:
getCanonicalName in interface CauchoNode

getLocalName

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

getNamespaceURI

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

getQName

public QName getQName()

getNodeValue

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

setNodeValue

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

getParentNode

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

getChildNodes

public org.w3c.dom.NodeList getChildNodes()
Specified by:
getChildNodes in interface org.w3c.dom.Node

getFirstChild

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

getLastChild

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

getPreviousSibling

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

getNextSibling

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

getAttributes

public org.w3c.dom.NamedNodeMap getAttributes()
Specified by:
getAttributes in interface org.w3c.dom.Node

insertBefore

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

replaceChild

public org.w3c.dom.Node replaceChild(org.w3c.dom.Node newChild,
                                     org.w3c.dom.Node refChild)
                              throws org.w3c.dom.DOMException
Specified by:
replaceChild in interface org.w3c.dom.Node
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
Throws:
org.w3c.dom.DOMException

appendChild

public org.w3c.dom.Node appendChild(org.w3c.dom.Node newNode)
                             throws org.w3c.dom.DOMException
Specified by:
appendChild in interface org.w3c.dom.Node
Throws:
org.w3c.dom.DOMException

hasChildNodes

public boolean hasChildNodes()
Specified by:
hasChildNodes in interface org.w3c.dom.Node

equals

public boolean equals(org.w3c.dom.Node arg,
                      boolean deep)

getNextPreorder

public QAbstractNode getNextPreorder()

hasContent

public boolean hasContent()

getNextContent

public QAbstractNode getNextContent()

getPreviousContent

public QAbstractNode getPreviousContent()

getTextValue

public java.lang.String getTextValue()
Description copied from interface: CauchoNode
Returns the text value of the node

Specified by:
getTextValue in interface CauchoNode

supports

public boolean supports(java.lang.String feature,
                        java.lang.String version)
Support the same and the implementation


normalize

public void normalize()
Specified by:
normalize in interface org.w3c.dom.Node

cloneNode

public org.w3c.dom.Node cloneNode(boolean deep)
Specified by:
cloneNode in interface org.w3c.dom.Node

compareTreePosition

public short compareTreePosition(org.w3c.dom.Node other)

getTextContent

public java.lang.String getTextContent()
                                throws org.w3c.dom.DOMException
Specified by:
getTextContent in interface org.w3c.dom.Node
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
Throws:
org.w3c.dom.DOMException

isSameNode

public boolean isSameNode(org.w3c.dom.Node other)
Specified by:
isSameNode in interface org.w3c.dom.Node

lookupNamespacePrefix

public java.lang.String lookupNamespacePrefix(java.lang.String namespaceURI,
                                              boolean useDefault)

isDefaultNamespace

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

lookupNamespaceURI

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

isEqualNode

public boolean isEqualNode(org.w3c.dom.Node arg)
Specified by:
isEqualNode in interface org.w3c.dom.Node

getInterface

public org.w3c.dom.Node getInterface(java.lang.String feature)

getDependencyList

public java.util.ArrayList<Depend> getDependencyList()

checkValid

public boolean checkValid()
                   throws java.lang.Exception
Description copied from interface: CauchoNode
For testing...

Specified by:
checkValid in interface CauchoNode
Throws:
java.lang.Exception

print

public void print(WriteStream out)
           throws java.io.IOException
Description copied from interface: CauchoNode
Prints the node to a stream

Specified by:
print in interface CauchoNode
Throws:
java.io.IOException

printPretty

public void printPretty(WriteStream out)
                 throws java.io.IOException
Description copied from interface: CauchoNode
Pretty-prints the node to a stream

Specified by:
printPretty in interface CauchoNode
Throws:
java.io.IOException

printHtml

public void printHtml(WriteStream out)
               throws java.io.IOException
Description copied from interface: CauchoNode
Prints the node as html to a stream

Specified by:
printHtml in interface CauchoNode
Throws:
java.io.IOException