站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > JBoss 4.0.1 sp1 jaxrpc API Documentation 英文版文档

NodeImpl (JAXRPC API) - JBoss 4.0.1 sp1 jaxrpc API Documentation 英文版文档


org.apache.axis.message
Class NodeImpl

java.lang.Object
  extended byorg.apache.axis.message.NodeImpl
All Implemented Interfaces:
Node, javax.xml.soap.Node
Direct Known Subclasses:
SOAPElementImpl, TextImpl

public class NodeImpl
extends Object
implements javax.xml.soap.Node

An implemenation of the abstract Node.

This class should not expose functionality that is not part of Node. 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.

Author:
Thomas Diesler (thomas.diesler@jboss.org)

Field Summary
protected  Node domNode
           
protected  SOAPElementImpl 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
 Node appendChild(Node newChild)
           
 Node cloneNode(boolean deep)
           
 void detachNode()
          Removes this Node object from the tree.
 NamedNodeMap getAttributes()
           
 NodeList getChildNodes()
           
 Node getFirstChild()
           
 Node getLastChild()
           
 String getLocalName()
           
 String getNamespaceURI()
           
 Node getNextSibling()
           
 String getNodeName()
           
 short getNodeType()
           
 String getNodeValue()
           
 Document getOwnerDocument()
           
 javax.xml.soap.SOAPElement getParentElement()
          Returns the parent node of this Node object.
 Node getParentNode()
           
 String getPrefix()
           
 Node getPreviousSibling()
           
 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()
           
 Node insertBefore(Node newChild, Node refChild)
           
 boolean isSupported(String feature, String version)
           
 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.
 Node removeChild(Node oldChild)
           
 Node replaceChild(Node newChild, Node oldChild)
           
 void setNodeValue(String nodeValue)
           
 void setParentElement(javax.xml.soap.SOAPElement parent)
          Sets the parent of this Node object to the given SOAPElement object.
 void setPrefix(String prefix)
           
 void setValue(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.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

soapParent

protected SOAPElementImpl soapParent

domNode

protected Node domNode
Method Detail

detachNode

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

Specified by:
detachNode in interface javax.xml.soap.Node

getParentElement

public javax.xml.soap.SOAPElement 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 javax.xml.soap.Node
Returns:
the SOAPElement object that is the parent of this Node object or null if this Node object is root

setParentElement

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

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

getValue

public 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 javax.xml.soap.Node
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(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 javax.xml.soap.Node
Parameters:
value - A value string
Throws:
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 javax.xml.soap.Node

getNodeName

public String getNodeName()
Specified by:
getNodeName in interface Node

getNodeValue

public String getNodeValue()
                    throws DOMException
Specified by:
getNodeValue in interface Node
Throws:
DOMException

setNodeValue

public void setNodeValue(String nodeValue)
                  throws DOMException
Specified by:
setNodeValue in interface Node
Throws:
DOMException

getNodeType

public short getNodeType()
Specified by:
getNodeType in interface Node

getParentNode

public Node getParentNode()
Specified by:
getParentNode in interface Node

getChildNodes

public NodeList getChildNodes()
Specified by:
getChildNodes in interface Node

getFirstChild

public Node getFirstChild()
Specified by:
getFirstChild in interface Node

getLastChild

public Node getLastChild()
Specified by:
getLastChild in interface Node

getPreviousSibling

public Node getPreviousSibling()
Specified by:
getPreviousSibling in interface Node

getNextSibling

public Node getNextSibling()
Specified by:
getNextSibling in interface Node

getAttributes

public NamedNodeMap getAttributes()
Specified by:
getAttributes in interface Node

getOwnerDocument

public Document getOwnerDocument()
Specified by:
getOwnerDocument in interface Node

insertBefore

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

replaceChild

public Node replaceChild(Node newChild,
                         Node oldChild)
                  throws DOMException
Specified by:
replaceChild in interface Node
Throws:
DOMException

removeChild

public Node removeChild(Node oldChild)
                 throws DOMException
Specified by:
removeChild in interface Node
Throws:
DOMException

appendChild

public Node appendChild(Node newChild)
                 throws DOMException
Specified by:
appendChild in interface Node
Throws:
DOMException

hasChildNodes

public boolean hasChildNodes()
Specified by:
hasChildNodes in interface Node

cloneNode

public Node cloneNode(boolean deep)
Specified by:
cloneNode in interface Node

normalize

public void normalize()
Specified by:
normalize in interface Node

isSupported

public boolean isSupported(String feature,
                           String version)
Specified by:
isSupported in interface Node

getNamespaceURI

public String getNamespaceURI()
Specified by:
getNamespaceURI in interface Node

getPrefix

public String getPrefix()
Specified by:
getPrefix in interface Node

setPrefix

public void setPrefix(String prefix)
               throws DOMException
Specified by:
setPrefix in interface Node
Throws:
DOMException

getLocalName

public String getLocalName()
Specified by:
getLocalName in interface Node

hasAttributes

public boolean hasAttributes()
Specified by:
hasAttributes in interface Node

hashCode

public int hashCode()

toString

public String toString()


Copyright © 2002 JBoss Group, LLC. All Rights Reserved.