APIdia Launch Partner
Top Description Inners Methods
javax.xml.xpath

public Interface XPathEvaluationResult<T>

Known Direct Implementers
com.sun.org.apache.xpath.internal.jaxp.XPathResultImpl
Type Parameters
<T>
the object type returned by the XPath evaluation.
Imports
java.util.Objects, javax.xml.namespace.QName, org.w3c.dom.Node

The XPathEvaluationResult interface represents the result of the evaluation of an XPath expression within the context of a particular node. The evaluation of an XPath expression can result in various result types as defined in XML Path Language (XPath) Version 1.0.
Since
9
See Also
XML Path Language (XPath) Version 1.0

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static enum
XPathEvaluationResult.XPathResultType

XPathResultType represents possible return types of an XPath evaluation.

Method Summary

Modifier and TypeMethod and Description
public XPathEvaluationResult.XPathResultType

Returns:

the result type
type
()

Return the result type as an enum specified by XPathResultType

public T

Returns:

The value of the result.
value
()

Returns the value of the result as the type <T> specified for the class.

Method Detail

typeback to summary
public XPathEvaluationResult.XPathResultType type()

Return the result type as an enum specified by XPathResultType

Returns:XPathEvaluationResult.XPathResultType

the result type

valueback to summary
public T value()

Returns the value of the result as the type <T> specified for the class.

Returns:T

The value of the result.

javax.xml.xpath back to summary

public final Enum XPathEvaluationResult.XPathResultType

extends Enum<XPathEvaluationResult.XPathResultType>
Class Inheritance

XPathResultType represents possible return types of an XPath evaluation. Provided as an enum type, it allows the use of switch statement. At the same time, a mapping is provided between the original QName types in XPathConstants and class types used in the generic methods.

Field Summary

Modifier and TypeField and Description
public static final XPathEvaluationResult.XPathResultType
ANY

Any type that represents any of the 5 other types listed below.

public static final XPathEvaluationResult.XPathResultType
BOOLEAN

The XPath 1.0 boolean data type.

pack-priv final Class<?>
public static final XPathEvaluationResult.XPathResultType
NODE

The XPath 1.0 Node data type.

public static final XPathEvaluationResult.XPathResultType
NODESET

The XPath 1.0 NodeSet data type.

public static final XPathEvaluationResult.XPathResultType
NUMBER

The XPath 1.0 Number data type.

pack-priv final QName
public static final XPathEvaluationResult.XPathResultType
STRING

The XPath 1.0 String data type.

Constructor Summary

AccessConstructor and Description
private
XPathResultType(QName qnameType, Class<?> clsType)

Method Summary

Modifier and TypeMethod and Description
private boolean

Returns:

true if the argument is not null and is a class type or accepted subtype that matches that this type represents, false otherwise.
equalsClassType
(Class<?>
class type
clsType
)

Compares this type to the specified class type.

public static QName

Returns:

the QName type that matches with the specified class type, null if there is no match
getQNameType
(Class<?>
a class type that the enum type supports
clsType
)

Returns the QName type as specified in XPathConstants that corresponds to the specified class type.

private boolean

Returns:

true if class type is an accepted subtype of Number, false otherwise
isAcceptedNumberSubType
(Class<?>
class type
clsType
)

Compares the specified class type to accepted subtypes of number.

public static XPathEvaluationResult.XPathResultType
public static XPathEvaluationResult.XPathResultType[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

ANYback to summary
public static final XPathEvaluationResult.XPathResultType ANY

Any type that represents any of the 5 other types listed below. Maps to XPathEvaluationResult.

BOOLEANback to summary
public static final XPathEvaluationResult.XPathResultType BOOLEAN

The XPath 1.0 boolean data type. Maps to Java Boolean.

clsTypeback to summary
pack-priv final Class<?> clsType
NODEback to summary
public static final XPathEvaluationResult.XPathResultType NODE

The XPath 1.0 Node data type. Maps to org.w3c.dom.Node.

NODESETback to summary
public static final XPathEvaluationResult.XPathResultType NODESET

The XPath 1.0 NodeSet data type. Maps to XPathNodes.

NUMBERback to summary
public static final XPathEvaluationResult.XPathResultType NUMBER

The XPath 1.0 Number data type. Maps to Java Number. Of the subtypes of Number, only Double, Integer and Long are required.

qnameTypeback to summary
pack-priv final QName qnameType
STRINGback to summary
public static final XPathEvaluationResult.XPathResultType STRING

The XPath 1.0 String data type. Maps to Java String.

Constructor Detail

XPathResultTypeback to summary
private XPathResultType(QName qnameType, Class<?> clsType)

Method Detail

equalsClassTypeback to summary
private boolean equalsClassType(Class<?> clsType)

Compares this type to the specified class type.

Parameters
clsType:Class<?>

class type

Returns:boolean

true if the argument is not null and is a class type or accepted subtype that matches that this type represents, false otherwise.

getQNameTypeback to summary
public static QName getQNameType(Class<?> clsType)

Returns the QName type as specified in XPathConstants that corresponds to the specified class type.

Parameters
clsType:Class<?>

a class type that the enum type supports

Returns:QName

the QName type that matches with the specified class type, null if there is no match

isAcceptedNumberSubTypeback to summary
private boolean isAcceptedNumberSubType(Class<?> clsType)

Compares the specified class type to accepted subtypes of number.

Parameters
clsType:Class<?>

class type

Returns:boolean

true if class type is an accepted subtype of Number, false otherwise

valueOfback to summary
public static XPathEvaluationResult.XPathResultType valueOf(String name)
valuesback to summary
public static XPathEvaluationResult.XPathResultType[] values()