|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
javax.xml.soap Interface Node
- All Superinterfaces:
- Node
- All Known Subinterfaces:
- Detail, DetailEntry, SOAPBody, SOAPBodyElement, SOAPElement, SOAPEnvelope, SOAPFault, SOAPFaultElement, SOAPHeader, SOAPHeaderElement, Text
public interface Node
- extends Node
Implements:
org.w3c.dom.Node
XML 文档中节点(元素)的表示形式。此接口扩展了标准的 DOM Node 接口,具有一些能获取和设置节点值、获取和设置父节点、移除节点的方法。
A representation of a node (element) in an XML document. This interface extnends the standard DOM Node interface with methods for getting and setting the value of a node, for getting and setting the parent of a node, and for removing a node.
Field Summary |
---|
Method Summary | |
---|---|
void |
detachNode()
Removes this Node object from the tree. |
SOAPElement |
getParentElement()
Returns the parent element of this Node object. |
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. |
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. |
void |
setParentElement(SOAPElement parent)
Sets the parent of this Node object to the given
SOAPElement object. |
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. |
Methods inherited from interface org.w3c.dom.Node |
---|
appendChild, cloneNode, compareDocumentPosition, getAttributes, getBaseURI, getChildNodes, getFeature, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, getTextContent, getUserData, hasAttributes, hasChildNodes, insertBefore, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, removeChild, replaceChild, setNodeValue, setPrefix, setTextContent, setUserData |
Method Detail |
---|
public String
getValue()
如果这是一个 Text
节点,则返回此节点的值,否则返回此节点的直接子节点值。如果此 Node
有一个直接子节点是 Text
节点,则返回该直接子节点的值。如果存在一个以上的 Text
节点,则返回第一个 Text
节点的值。否则返回 null
。
return |
如果此节点是一个 Text 节点或该文本由此 Node 对象(该对象是一个 Text 对象)的第一个直接子节点(如果这种子节点存在)包含,则返回带有此节点文本的 String ;否则返回 null 。
|
getValue
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 thisNode
that it is aText
node then it's value will be returned. If there is more than oneText
node then the value of the firstText
Node will be returned. Otherwisenull
is returned. - Returns:
- a
String
with the text of this node if this is aText
node or the text contained by the first immediate child of thisNode
object that is aText
object if such a child exists;null
otherwise.
public void
setValue(String value)
如果这是一个 Text 节点,则此方法会设置它的值,否则该方法设置此节点的直接 (Text) 子节点值。仅当存在子节点且该节点是 Text
节点时,才能设置此节点的直接子节点值,如果没有子节点,则将创建 Text
子节点。
Throws | IllegalStateException:
如果该节点不是 Text 节点,也没有子节点或者有一个子节点但不是 Text 节点。 |
since | SAAJ 1.2 |
setValue
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 childText
node will be created. - Throws:
IllegalStateException
- if the node is not aText
node and either has more than one child node or has a child node that is not aText
node.- Since:
- SAAJ 1.2
public void
setParentElement(SOAPElement parent) throws SOAPException
将此 Node
对象的父节点设置为给定的 SOAPElement
对象。
parent |
要设置为此 Node 对象父节点的 SOAPElement 对象 |
Throws | SOAPException: 如果将父节点设置为给定元素时出现错误 |
See also | getParentElement |
setParentElement
void setParentElement(SOAPElement parent) throws SOAPException
- Sets the parent of this
Node
object to the givenSOAPElement
object. - Parameters:
parent
- theSOAPElement
object to be set as the parent of thisNode
object- Throws:
SOAPException
- if there is a problem in setting the parent to the given element- See Also:
getParentElement()
public SOAPElement
getParentElement()
返回此 Node
对象的父元素。如果树没有存入内存,则此方法抛出 UnsupportedOperationException
。
return |
此 Node 对象的父节点 SOAPElement 对象;如果此 Node 对象为根节点,则返回 null
|
Throws | UnsupportedOperationException: 如果整个树没有存入内存 |
See also | setParentElement |
getParentElement
SOAPElement getParentElement()
- Returns the parent element of this
Node
object. This method can throw anUnsupportedOperationException
if the tree is not kept in memory. - Returns:
- the
SOAPElement
object that is the parent of thisNode
object ornull
if thisNode
object is root - Throws:
UnsupportedOperationException
- if the whole tree is not kept in memory- See Also:
setParentElement(javax.xml.soap.SOAPElement)
public void
detachNode()
从树中移除此 Node
对象。
英文文档:
detachNode
void detachNode()
- Removes this
Node
object from the tree.
public void
recycleNode()
通知实现此 Node
对象不再由应用程序使用,对于以后可能创建的节点,实现可以随意重用此对象。
调用 recycleNode
方法意味着以前调用过 detachNode
方法。
recycleNode
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 methoddetachNode
has been called previously.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Submit a bug or feature
Copyright 2007 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.
PS : 未经我党受权你也可自由散发此文档。 如有任何错误请自行修正;若因此而造成任何损失请直接找人民主席,请勿与本人联系。谢谢!