|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--org.apache.xpath.domapi.XPathResultImpl
**Experimental** The class provides an implementation XPathResult according to the DOM L3 XPath Specification, Working Draft 28, March 2002.
See also the Document Object Model (DOM) Level 3 XPath Specification.
The XPathResult 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,
XPathResult| Method Summary | |
boolean |
getBooleanValue()
|
boolean |
getInvalidIteratorState()
|
double |
getNumberValue()
The value of this number result. |
short |
getResultType()
|
Node |
getSingleNodeValue()
The value of this single node result, which may be null. |
int |
getSnapshotLength()
The number of nodes in the result snapshot. |
java.lang.String |
getStringValue()
The value of this string result. |
java.lang.String |
getTypeString(int type)
Given a request type, return the equivalent string. |
void |
handleEvent(Event event)
|
static boolean |
isValidType(short type)
Check if the specified type is one of the supported types. |
Node |
iterateNext()
Iterates and returns the next node from the node set or nullif there are no more nodes. |
Node |
snapshotItem(int index)
Returns the indexth item in the snapshot collection. |
| Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
| Method Detail |
public short getResultType()
XPathResult.getResultType()
public double getNumberValue()
throws XPathException
resultType is not
NUMBER_TYPE.XPathResult.getNumberValue()
public java.lang.String getStringValue()
throws XPathException
resultType is not
STRING_TYPE.XPathResult.getStringValue()
public boolean getBooleanValue()
throws XPathException
XPathResult.getBooleanValue()
public Node getSingleNodeValue()
throws XPathException
null.resultType is not
ANY_UNORDERED_NODE_TYPE or
FIRST_ORDERED_NODE_TYPE.XPathResult.getSingleNodeValue()public boolean getInvalidIteratorState()
XPathResult.getInvalidIteratorState()
public int getSnapshotLength()
throws XPathException
0 to
snapshotLength-1 inclusive.resultType is not
UNORDERED_NODE_SNAPSHOT_TYPE or
ORDERED_NODE_SNAPSHOT_TYPE.XPathResult.getSnapshotLength()
public Node iterateNext()
throws XPathException,
DOMException
nullif there are no more nodes.resultType is not
UNORDERED_NODE_ITERATOR_TYPE or
ORDERED_NODE_ITERATOR_TYPE.XPathResult.iterateNext()
public Node snapshotItem(int index)
throws XPathException
indexth item in the snapshot collection. If
index is greater than or equal to the number of nodes in
the list, this method returns null. Unlike the iterator
result, the snapshot does not become invalid, but may not correspond
to the current document if it is mutated.index - Index into the snapshot collection.indexth position in the
NodeList, or null if that is not a valid
index.resultType is not
UNORDERED_NODE_SNAPSHOT_TYPE or
ORDERED_NODE_SNAPSHOT_TYPE.XPathResult.snapshotItem(int)public static boolean isValidType(short type)
type - The specified typepublic void handleEvent(Event event)
EventListener.handleEvent(Event)public java.lang.String getTypeString(int type)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||