org.jboss.axis.message
Class NodeImpl

java.lang.Object
  extended byorg.jboss.axis.message.NodeImpl
All Implemented Interfaces:
Node (src) , org.w3c.dom.Node
Direct Known Subclasses:
SOAPElementImpl (src) , TextImpl (src)

public class NodeImpl
extends java.lang.Object
implements Node (src)

An implemenation of the abstract Node.

This class should not expose functionality that is not part of Node (src) . Client code should use javax.xml.soap.Node instead of this class.

When creating a DOM2 tree the objects maintained by the tree are org.w3c.dom.Node objects and not javax.xml.soap.Node objects.

This implementation schields the client from the the underlying DOM2 tree, returning javax.xml.soap.Node objects.


Field Summary
protected  org.w3c.dom.Node domNode
           
protected  SOAPElementImpl (src) soapParent
           
 
Fields inherited from interface org.w3c.dom.Node
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE
 
Method Summary
 org.w3c.dom.Node appendChild(org.w3c.dom.Node newChild)
           
 org.w3c.dom.Node cloneNode(boolean deep)
           
 short compareDocumentPosition(org.w3c.dom.Node other)
           
 void detachNode()
          Removes this Node object from the tree.
 org.w3c.dom.NamedNodeMap getAttributes()
           
 java.lang.String getBaseURI()
           
 org.w3c.dom.NodeList getChildNodes()
           
 java.lang.Object getFeature(java.lang.String feature, java.lang.String version)
           
 org.w3c.dom.Node getFirstChild()
           
 org.w3c.dom.Node getLastChild()
           
 java.lang.String getLocalName()
           
 java.lang.String getNamespaceURI()
           
 org.w3c.dom.Node getNextSibling()
           
 java.lang.String getNodeName()
           
 short getNodeType()
           
 java.lang.String getNodeValue()
           
 org.w3c.dom.Document getOwnerDocument()
           
 SOAPElement (src) getParentElement()
          Returns the parent node of this Node object.
 org.w3c.dom.Node getParentNode()
           
 java.lang.String getPrefix()
           
 org.w3c.dom.Node getPreviousSibling()
           
 java.lang.String getTextContent()
           
 java.lang.Object getUserData(java.lang.String key)
           
 java.lang.String getValue()
          Returns the value of this node if this is a Text node or the value of the immediate child of this node otherwise.
 boolean hasAttributes()
           
 boolean hasChildNodes()
           
 int hashCode()
           
 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 lookupNamespaceURI(java.lang.String prefix)
           
 java.lang.String lookupPrefix(java.lang.String namespaceURI)
           
 void normalize()
           
 void recycleNode()
          Notifies the implementation that this Node object is no longer being used by the application and that the implementation is free to reuse this object for nodes that may be created later.
 org.w3c.dom.Node removeChild(org.w3c.dom.Node oldChild)
           
 org.w3c.dom.Node replaceChild(org.w3c.dom.Node newChild, org.w3c.dom.Node oldChild)
           
 void setNodeValue(java.lang.String nodeValue)
           
 void setParentElement(SOAPElement (src)  parent)
          Sets the parent of this Node object to the given SOAPElement object.
 void setPrefix(java.lang.String prefix)
           
 void setTextContent(java.lang.String textContent)
           
 java.lang.Object setUserData(java.lang.String key, java.lang.Object data, UserDataHandler (src)  handler)
           
 void setValue(java.lang.String value)
          If this is a Text node then this method will set its value, otherwise it sets the value of the immediate (Text) child of this node.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

soapParent

protected SOAPElementImpl (src)  soapParent

domNode

protected org.w3c.dom.Node domNode
Method Detail

detachNode

public void detachNode()
Removes this Node object from the tree.

Specified by:
detachNode in interface Node (src)

getParentElement

public SOAPElement (src)  getParentElement()
Returns the parent node of this Node object. This method can throw an UnsupportedOperationException if the tree is not kept in memory.

Specified by:
getParentElement in interface Node (src)
Returns:
the SOAPElement object that is the parent of this Node object or null if this Node object is root

setParentElement

public void setParentElement(SOAPElement (src)  parent)
                      throws SOAPException (src) 
Sets the parent of this Node object to the given SOAPElement object.

Specified by:
setParentElement in interface Node (src)
Parameters:
parent - the SOAPElement object to be set as the parent of this Node object
Throws:
SOAPException (src) - if there is a problem in setting the parent to the given node

getValue

public java.lang.String getValue()
Returns the value of this node if this is a Text node or the value of the immediate child of this node otherwise.

If there is an immediate child of this Node that it is a Text node then it's value will be returned. If there is more than one Text node then the value of the first Text Node will be returned. Otherwise null is returned.

Specified by:
getValue in interface Node (src)
Returns:
a String with the text of this node if this is a Text node or the text contained by the first immediate child of this Node object that is a Text object if such a child exists; null otherwise.

setValue

public void setValue(java.lang.String value)
If this is a Text node then this method will set its value, otherwise it sets the value of the immediate (Text) child of this node.

The value of the immediate child of this node can be set only if, there is one child node and that node is a Text node, or if there are no children in which case a child Text node will be created.

Specified by:
setValue in interface Node (src)
Parameters:
value - A value string
Throws:
java.lang.IllegalStateException - if the node is not a Text node and either has more than one child node or has a child node that is not a Text node.

recycleNode

public void recycleNode()
Notifies the implementation that this Node object is no longer being used by the application and that the implementation is free to reuse this object for nodes that may be created later. Calling the method recycleNode implies that the method detachNode has been called previously.

Specified by:
recycleNode in interface Node (src)

getNodeName

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

getNodeValue

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

setNodeValue

public void setNodeValue(java.lang.String nodeValue)
                  throws org.w3c.dom.DOMException
Specified by:
setNodeValue in interface org.w3c.dom.Node
Throws:
org.w3c.dom.DOMException

getNodeType

public short getNodeType()
Specified by:
getNodeType 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

getOwnerDocument

public org.w3c.dom.Document getOwnerDocument()
Specified by:
getOwnerDocument 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 oldChild)
                              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 newChild)
                             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

cloneNode

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

normalize

public void normalize()
Specified by:
normalize 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

getNamespaceURI

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

getPrefix

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

setPrefix

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

getLocalName

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

hasAttributes

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

hashCode

public int hashCode()

toString

public java.lang.String toString()

getBaseURI

public java.lang.String getBaseURI()

compareDocumentPosition

public short compareDocumentPosition(org.w3c.dom.Node other)
                              throws org.w3c.dom.DOMException
Throws:
org.w3c.dom.DOMException

getTextContent

public java.lang.String getTextContent()
                                throws org.w3c.dom.DOMException
Throws:
org.w3c.dom.DOMException

setTextContent

public void setTextContent(java.lang.String textContent)
                    throws org.w3c.dom.DOMException
Throws:
org.w3c.dom.DOMException

isSameNode

public boolean isSameNode(org.w3c.dom.Node other)

lookupPrefix

public java.lang.String lookupPrefix(java.lang.String namespaceURI)

isDefaultNamespace

public boolean isDefaultNamespace(java.lang.String namespaceURI)

lookupNamespaceURI

public java.lang.String lookupNamespaceURI(java.lang.String prefix)

isEqualNode

public boolean isEqualNode(org.w3c.dom.Node arg)

getFeature

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

setUserData

public java.lang.Object setUserData(java.lang.String key,
                                    java.lang.Object data,
                                    UserDataHandler (src)  handler)

getUserData

public java.lang.Object getUserData(java.lang.String key)