com.caucho.xml
Class QElement

java.lang.Object
  extended by com.caucho.xml.QAbstractNode
      extended by com.caucho.xml.QNode
          extended by com.caucho.xml.QAttributedNode
              extended by com.caucho.xml.QElement
All Implemented Interfaces:
CauchoElement, CauchoNode, java.io.Serializable, org.w3c.dom.Element, org.w3c.dom.Node

public class QElement
extends QAttributedNode
implements CauchoElement

Resin's implementation of the DOM element.

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.QNode
_firstChild, _lastChild
 
Fields inherited from class com.caucho.xml.QAbstractNode
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
  QElement()
          Create a new element.
protected QElement(QDocument owner, QName name)
           
  QElement(QName name)
          Create a new named element.
  QElement(java.lang.String name)
          Create a new named element.
  QElement(java.lang.String name, java.lang.String namespace)
          Create a new named element.
 
Method Summary
 org.w3c.dom.Node appendChild(org.w3c.dom.Node child)
          Appends a new node as the last child of the element.
 boolean equals(org.w3c.dom.Node arg, boolean deep)
           
 boolean equals(java.lang.Object arg)
           
 java.lang.String getCanonicalName()
          Returns the canonical name of the element.
 org.w3c.dom.NodeList getElementsByTagName(java.lang.String tagName)
          Returns a list of elements, given a tag name.
 org.w3c.dom.NodeList getElementsByTagNameNS(java.lang.String uri, java.lang.String name)
          Returns a list of elements, given a namespace and a local name.
 java.lang.String getLocalName()
          Returns the local part of the element's name.
 java.lang.String getNamespace(java.lang.String prefix)
          Given a prefix, returns the namespace in effect at this element.
 java.lang.String getNamespaceURI()
          Returns the namespace of the element.
 java.lang.String getNodeName()
          Returns the element's qualified-name as the node name.
 short getNodeType()
          Returns the DOM NodeType, ELEMENT_NODE.
 java.lang.String getPrefix()
          Returns the namespace prefix for the element.
 QName getQName()
          Returns the qname
 org.w3c.dom.TypeInfo getSchemaTypeInfo()
          Returns the schema type.
 java.lang.String getTagName()
          Returns the element's qualified-name as the node name.
 java.lang.String getTextValue()
          Returns the text value of the element.
 boolean hasContent()
           
 void normalize()
          Normalize the element, i.e.
 void setName(QName name)
          Assign a name to the element.
 java.lang.String toString()
           
 
Methods inherited from class com.caucho.xml.QAttributedNode
getAttribute, getAttributeNode, getAttributeNodeNS, getAttributeNS, getAttributes, getFirstAttribute, hasAttribute, hasAttributeNS, hasAttributes, removeAttribute, removeAttributeNode, removeAttributeNodeNS, removeAttributeNS, setAttribute, setAttributeNode, setAttributeNodeNS, setAttributeNS, setIdAttribute, setIdAttributeNode, setIdAttributeNS, unlink
 
Methods inherited from class com.caucho.xml.QNode
checkValid, getChildNodes, getFirstChild, getLastChild, getNextPreorder, getNextSibling, getNodeValue, getPreviousSibling, hasChildNodes, insertBefore, removeChild, replaceChild, setNodeValue, setTextContent
 
Methods inherited from class com.caucho.xml.QAbstractNode
baseURI, cloneNode, compareDocumentPosition, compareTreePosition, getBaseURI, getColumn, getDependencyList, getFeature, getFilename, getInterface, getLine, getNextContent, getOwnerDocument, getParentNode, getPreviousContent, getTextContent, getUserData, isDefaultNamespace, isEqualNode, isSameNode, isSupported, 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.CauchoElement
getFirstAttribute
 
Methods inherited from interface org.w3c.dom.Element
getAttribute, getAttributeNode, getAttributeNodeNS, getAttributeNS, hasAttribute, hasAttributeNS, removeAttribute, removeAttributeNode, removeAttributeNS, setAttribute, setAttributeNode, setAttributeNodeNS, setAttributeNS, setIdAttribute, setIdAttributeNode, setIdAttributeNS
 
Methods inherited from interface com.caucho.xml.CauchoNode
checkValid, getBaseURI, getColumn, getFilename, getLine, print, printHtml, printPretty, setLocation
 
Methods inherited from interface org.w3c.dom.Node
cloneNode, compareDocumentPosition, getAttributes, getChildNodes, getFeature, getFirstChild, getLastChild, getNextSibling, getNodeValue, getOwnerDocument, getParentNode, getPreviousSibling, getTextContent, getUserData, hasAttributes, hasChildNodes, insertBefore, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, removeChild, replaceChild, setNodeValue, setPrefix, setTextContent, setUserData
 

Constructor Detail

QElement

public QElement()
Create a new element.


QElement

public QElement(java.lang.String name)
Create a new named element.

Parameters:
name - the element's name.

QElement

public QElement(java.lang.String name,
                java.lang.String namespace)
Create a new named element.

Parameters:
name - the element's name.

QElement

public QElement(QName name)
Create a new named element.

Parameters:
name - the element's name.

QElement

protected QElement(QDocument owner,
                   QName name)
Method Detail

setName

public void setName(QName name)
Assign a name to the element. Not normally called by external API.

Parameters:
name - the element's name.

getQName

public QName getQName()
Returns the qname

Specified by:
getQName in interface CauchoElement
Overrides:
getQName in class QAbstractNode

getNodeName

public java.lang.String getNodeName()
Returns the element's qualified-name as the node name.

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

getTagName

public java.lang.String getTagName()
Returns the element's qualified-name as the node name.

Specified by:
getTagName in interface org.w3c.dom.Element

getLocalName

public java.lang.String getLocalName()
Returns the local part of the element's name.

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

getPrefix

public java.lang.String getPrefix()
Returns the namespace prefix for the element.

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

getCanonicalName

public java.lang.String getCanonicalName()
Returns the canonical name of the element.

Specified by:
getCanonicalName in interface CauchoNode
Overrides:
getCanonicalName in class QAbstractNode

getNamespaceURI

public java.lang.String getNamespaceURI()
Returns the namespace of the element.

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

getNamespace

public java.lang.String getNamespace(java.lang.String prefix)
Given a prefix, returns the namespace in effect at this element.

Specified by:
getNamespace in interface CauchoElement
Parameters:
prefix - the prefix to test.
Returns:
the namespace URL matching the prefix or null.

getNodeType

public short getNodeType()
Returns the DOM NodeType, ELEMENT_NODE.

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

getSchemaTypeInfo

public org.w3c.dom.TypeInfo getSchemaTypeInfo()
Returns the schema type.

Specified by:
getSchemaTypeInfo in interface org.w3c.dom.Element

getElementsByTagName

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

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

getElementsByTagNameNS

public org.w3c.dom.NodeList getElementsByTagNameNS(java.lang.String uri,
                                                   java.lang.String name)
Returns a list of elements, given a namespace and a local name.

Specified by:
getElementsByTagNameNS in interface org.w3c.dom.Element

appendChild

public org.w3c.dom.Node appendChild(org.w3c.dom.Node child)
                             throws org.w3c.dom.DOMException
Appends a new node as the last child of the element.

Specified by:
appendChild in interface org.w3c.dom.Node
Overrides:
appendChild in class QNode
Parameters:
child - the new child.
Returns:
the child.
Throws:
org.w3c.dom.DOMException

normalize

public void normalize()
Normalize the element, i.e. smash all neighboring text nodes together.

Specified by:
normalize in interface org.w3c.dom.Node
Overrides:
normalize in class QNode

hasContent

public boolean hasContent()
Overrides:
hasContent in class QAbstractNode

equals

public boolean equals(java.lang.Object arg)
Overrides:
equals in class QNode

equals

public boolean equals(org.w3c.dom.Node arg,
                      boolean deep)
Overrides:
equals in class QNode

getTextValue

public java.lang.String getTextValue()
Returns the text value of the element. For an element, the text value is the smashing together of all the child text nodes.

Specified by:
getTextValue in interface CauchoNode
Overrides:
getTextValue in class QAbstractNode

toString

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