| Prev Class | Next Class | Frames | No Frames |
| Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Objectorg.apache.xpath.domapi.XPathResultImplXPathResult interface represents the result of the
evaluation of an XPath expression within the context of a particular
node. Since evaluation of an XPath expression can result in various
result types, this object makes it possible to discover and manipulate
the type and value of the result.
This implementation wraps an XObject.
XObject, XPathResultNested Class Summary |
Fields inherited from interface org.w3c.dom.xpath.XPathResult | |
ANY_TYPE, ANY_UNORDERED_NODE_TYPE, BOOLEAN_TYPE, FIRST_ORDERED_NODE_TYPE, NUMBER_TYPE, ORDERED_NODE_ITERATOR_TYPE, ORDERED_NODE_SNAPSHOT_TYPE, STRING_TYPE, UNORDERED_NODE_ITERATOR_TYPE, UNORDERED_NODE_SNAPSHOT_TYPE | |
Method Summary | |
boolean | |
boolean | |
double |
|
short | |
Node |
|
int |
|
String |
|
String |
|
void |
|
static boolean |
|
Node |
|
Node |
|
public boolean getBooleanValue()
throws XPathException
- Specified by:
- getBooleanValue in interface XPathResult
- See Also:
XPathResult.getBooleanValue()
public boolean getInvalidIteratorState()
- Specified by:
- getInvalidIteratorState in interface XPathResult
public double getNumberValue()
throws XPathExceptionThe value of this number result.
- Specified by:
- getNumberValue in interface XPathResult
- Throws:
XPathException- TYPE_ERR: raised ifresultTypeis notNUMBER_TYPE.
- See Also:
XPathResult.getNumberValue()
public short getResultType()
- Specified by:
- getResultType in interface XPathResult
- See Also:
XPathResult.getResultType()
public Node getSingleNodeValue() throws XPathException
The value of this single node result, which may benull.
- Specified by:
- getSingleNodeValue in interface XPathResult
- Throws:
XPathException- TYPE_ERR: raised ifresultTypeis notANY_UNORDERED_NODE_TYPEorFIRST_ORDERED_NODE_TYPE.
- See Also:
XPathResult.getSingleNodeValue()
public int getSnapshotLength()
throws XPathExceptionThe number of nodes in the result snapshot. Valid values for snapshotItem indices are0tosnapshotLength-1inclusive.
- Specified by:
- getSnapshotLength in interface XPathResult
- Throws:
XPathException- TYPE_ERR: raised ifresultTypeis notUNORDERED_NODE_SNAPSHOT_TYPEorORDERED_NODE_SNAPSHOT_TYPE.
- See Also:
XPathResult.getSnapshotLength()
public String getStringValue()
throws XPathExceptionThe value of this string result.
- Specified by:
- getStringValue in interface XPathResult
- Throws:
XPathException- TYPE_ERR: raised ifresultTypeis notSTRING_TYPE.
- See Also:
XPathResult.getStringValue()
public String getTypeString(int type)
Given a request type, return the equivalent string. For diagnostic purposes.
- Returns:
- type string
public void handleEvent(Event event)
- Specified by:
- handleEvent in interface EventListener
- See Also:
EventListener.handleEvent(Event)
public static boolean isValidType(short type)
Check if the specified type is one of the supported types.
- Parameters:
type- The specified type
- Returns:
- true If the specified type is supported; otherwise, returns false.
public Node iterateNext() throws XPathException, DOMException
Iterates and returns the next node from the node set ornullif there are no more nodes.
- Specified by:
- iterateNext in interface XPathResult
- Returns:
- Returns the next node.
- Throws:
XPathException- TYPE_ERR: raised ifresultTypeis notUNORDERED_NODE_ITERATOR_TYPEorORDERED_NODE_ITERATOR_TYPE.DOMException- INVALID_STATE_ERR: The document has been mutated since the result was returned.
- See Also:
XPathResult.iterateNext()
public Node snapshotItem(int index) throws XPathException
Returns theindexth item in the snapshot collection. Ifindexis greater than or equal to the number of nodes in the list, this method returnsnull. Unlike the iterator result, the snapshot does not become invalid, but may not correspond to the current document if it is mutated.
- Specified by:
- snapshotItem in interface XPathResult
- Parameters:
index- Index into the snapshot collection.
- Returns:
- The node at the
indexth position in theNodeList, ornullif that is not a valid index.
- Throws:
XPathException- TYPE_ERR: raised ifresultTypeis notUNORDERED_NODE_SNAPSHOT_TYPEorORDERED_NODE_SNAPSHOT_TYPE.
- See Also:
XPathResult.snapshotItem(int)