public class XPathResult
extends java.lang.Object
Constructor and Description |
---|
XPathResult(com.teamdev.jxbrowser.chromium.internal.ipc.Channel channel, com.teamdev.jxbrowser.chromium.dom.internal.DOMFactory factory, long resultId, java.lang.String errorMsg) |
Modifier and Type | Method and Description |
---|---|
boolean |
getBoolean()
Returns the result represented as a boolean.
返回表示为布尔值的结果。 |
java.lang.String |
getErrorMessage()
Returns the error message if the last operation failed.
如果最后一个操作失败,则返回错误消息。 |
XPathIterator |
getIterator()
Returns iterator over the XPath result node set.
返回XPath结果节点集上的迭代器。 |
double |
getNumber()
Returns the result represented as a number.
返回以数字表示的结果。 |
XPathResultType |
getResultType()
Returns the result type.
返回结果类型。 |
DOMNode |
getSingleNode()
Returns the result represented as a single node.
返回表示为单个节点的结果。 |
java.util.List<DOMNode> |
getSnapshotNodes()
Returns the list of nodes when the result type is
当结果类型为XPathResultType.ORDERED_NODE_SNAPSHOT_TYPE或XPathResultType.UNORDERED_NODE_SNAPSHOT_TYPE时,返回节点列表。 XPathResultType.ORDERED_NODE_SNAPSHOT_TYPE or
XPathResultType.UNORDERED_NODE_SNAPSHOT_TYPE .
|
java.lang.String |
getString()
Returns the result represented as a string.
返回以字符串表示的结果。 |
boolean |
isBoolean()
Returns
如果结果为XPathResultType.BOOLEAN_TYPE,则返回true true if the result is
XPathResultType.BOOLEAN_TYPE
|
boolean |
isError()
Returns
发生错误时返回true。 true when an error occurred.
|
boolean |
isIterator()
Returns
如果结果为XPathResultType.ORDERED_NODE_ITERATOR_TYPE或XPathResultType.UNORDERED_NODE_ITERATOR_TYPE,则返回true true if the result is
XPathResultType.ORDERED_NODE_ITERATOR_TYPE or
XPathResultType.UNORDERED_NODE_ITERATOR_TYPE
|
boolean |
isNumber()
Returns
如果结果类型为XPathResultType.NUMBER_TYPE,则返回true。 true if the result type is
XPathResultType.NUMBER_TYPE .
|
boolean |
isSingleNode()
Returns
如果结果为XPathResultType.FIRST_ORDERED_NODE_TYPE或XPathResultType.ANY_UNORDERED_NODE_TYPE,则返回true true if the result is
XPathResultType.FIRST_ORDERED_NODE_TYPE or
XPathResultType.ANY_UNORDERED_NODE_TYPE
|
boolean |
isSnapshotNodes()
Returns
如果结果为XPathResultType.ORDERED_NODE_SNAPSHOT_TYPE或XPathResultType.UNORDERED_NODE_SNAPSHOT_TYPE,则返回true true if the result is
XPathResultType.ORDERED_NODE_SNAPSHOT_TYPE or
XPathResultType.UNORDERED_NODE_SNAPSHOT_TYPE
|
boolean |
isString()
Returns
如果结果为XPathResultType.STRING_TYPE,则返回true true if the result is
XPathResultType.STRING_TYPE
|
public XPathResult(com.teamdev.jxbrowser.chromium.internal.ipc.Channel channel, com.teamdev.jxbrowser.chromium.dom.internal.DOMFactory factory, long resultId, java.lang.String errorMsg)
public XPathResultType getResultType()
null
if an error occurred when evaluating XPath expression.
结果类型,或者在评估XPath表达式时发生错误。
public double getNumber()
public boolean isNumber()
true
if the result type is
XPathResultType.NUMBER_TYPE
.
true
if the result type is
XPathResultType.NUMBER_TYPE
.
如果结果类型为。
public java.lang.String getString()
public boolean isString()
true
if the result is
XPathResultType.STRING_TYPE
true
if the result is
XPathResultType.STRING_TYPE
如果结果是
public boolean getBoolean()
public boolean isBoolean()
true
if the result is
XPathResultType.BOOLEAN_TYPE
true
if the result is
XPathResultType.BOOLEAN_TYPE
如果结果是
public DOMNode getSingleNode()
public boolean isSingleNode()
true
if the result is
XPathResultType.FIRST_ORDERED_NODE_TYPE
or
XPathResultType.ANY_UNORDERED_NODE_TYPE
true
if the result is
XPathResultType.FIRST_ORDERED_NODE_TYPE
or
XPathResultType.ANY_UNORDERED_NODE_TYPE
如果结果是或
public XPathIterator getIterator()
public boolean isIterator()
true
if the result is
XPathResultType.ORDERED_NODE_ITERATOR_TYPE
or
XPathResultType.UNORDERED_NODE_ITERATOR_TYPE
true
if the result is
XPathResultType.ORDERED_NODE_ITERATOR_TYPE
or
XPathResultType.UNORDERED_NODE_ITERATOR_TYPE
如果结果是或
public java.util.List<DOMNode> getSnapshotNodes()
XPathResultType.ORDERED_NODE_SNAPSHOT_TYPE
or
XPathResultType.UNORDERED_NODE_SNAPSHOT_TYPE
. This list do not change with document mutations, but some elements may no longer exist in the current document as a result of these mutations.
XPathResultType.ORDERED_NODE_SNAPSHOT_TYPE
or
XPathResultType.UNORDERED_NODE_SNAPSHOT_TYPE
.
结果类型为或时的节点列表。
public boolean isSnapshotNodes()
true
if the result is
XPathResultType.ORDERED_NODE_SNAPSHOT_TYPE
or
XPathResultType.UNORDERED_NODE_SNAPSHOT_TYPE
true
if the result is
XPathResultType.ORDERED_NODE_SNAPSHOT_TYPE
or
XPathResultType.UNORDERED_NODE_SNAPSHOT_TYPE
返回结果是否为或
public boolean isError()
true
when an error occurred. You can call
getErrorMessage()
method to retrieve the last error message.
true
when an error occurred.
当发生错误时。
public java.lang.String getErrorMessage()