Package com.teamdev.jxbrowser.dom
Interface XPathResult
public interface XPathResult
An implementation of the DOM W3C XPathResult
interface that represents the result of the XPath expression evaluation.
-
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns the XPath result represented as a boolean.doubleasNumber()Returns the XPath result represented as a number.Returns anOptionalthat contains the XPath result represented as a single node or an emptyOptionalif it does not exist.Returns the XPath result represented as an immutable list of the snapshot nodes.asString()Returns the XPath result represented as a string.booleanReturnstrueif the result type isXPathResultType.BOOLEAN.booleanReturnstrueif the result type isXPathResultType.UNORDERED_NODE_ITERATORorXPathResultType.ORDERED_NODE_ITERATOR.booleanisNumber()Returnstrueif the result type isXPathResultType.NUMBER.booleanReturnstrueif the result type isXPathResultType.FIRST_ORDERED_NODEorXPathResultType.ANY_UNORDERED_NODE.booleanReturnstrueif the result type isXPathResultType.ORDERED_NODE_SNAPSHOTorXPathResultType.UNORDERED_NODE_SNAPSHOT.booleanisString()Returnstrueif the result type isXPathResultType.STRING.type()Returns the result type.
-
Method Details
-
type
XPathResultType type()Returns the result type. -
asNumber
double asNumber()Returns the XPath result represented as a number.- Throws:
XPathException- if the result is not of a number type (seeisNumber())ObjectClosedException- when the document this instance belongs to is closed
-
isNumber
boolean isNumber()Returnstrueif the result type isXPathResultType.NUMBER. -
asString
String asString()Returns the XPath result represented as a string.- Throws:
XPathException- if the result is not of a string type (seeisString())ObjectClosedException- when the document this instance belongs to is closed
-
isString
boolean isString()Returnstrueif the result type isXPathResultType.STRING. -
asBoolean
boolean asBoolean()Returns the XPath result represented as a boolean.- Throws:
XPathException- if the result is not of a boolean type (seeisBoolean())ObjectClosedException- when the document this instance belongs to is closed
-
isBoolean
boolean isBoolean()Returnstrueif the result type isXPathResultType.BOOLEAN. -
asSingleNode
Returns anOptionalthat contains the XPath result represented as a single node or an emptyOptionalif it does not exist.- Throws:
XPathException- if the result is not of a single node type (seeisSingleNode())ObjectClosedException- when the document this instance belongs to is closed
-
isSingleNode
boolean isSingleNode()Returnstrueif the result type isXPathResultType.FIRST_ORDERED_NODEorXPathResultType.ANY_UNORDERED_NODE. -
iterateNext
Moves the iterator to the next node in the result set and returns anOptionalthat contains theNodeobject referenced by the current iterator. When iteration is over, returns an emptyOptional.- Throws:
XPathException- if the current result is not of an iterator type (seeisIterator())ObjectClosedException- when the document this instance belongs to is closed
-
isIterator
boolean isIterator()Returnstrueif the result type isXPathResultType.UNORDERED_NODE_ITERATORorXPathResultType.ORDERED_NODE_ITERATOR. -
asSnapshotNodes
Returns the XPath result represented as an immutable list of the snapshot nodes.- Throws:
XPathException- if the current result is not of a list of the snapshot nodes (seeisSnapshotNodes())ObjectClosedException- when the document this instance belongs to is closed
-
isSnapshotNodes
boolean isSnapshotNodes()Returnstrueif the result type isXPathResultType.ORDERED_NODE_SNAPSHOTorXPathResultType.UNORDERED_NODE_SNAPSHOT.
-