public final class XPathExpressions extends Object
XPathExpression
.Modifier and Type | Method and Description |
---|---|
static boolean |
getBoolean(Node node,
XPathExpression expression)
Evaluates the compiled XPath expression in the specified context and returns
a
Boolean . |
static <T extends Node> |
getNode(Node node,
XPathExpression expression)
Evaluates the compiled XPath expression in the specified context and
optionally returns a
Node . |
static NodeList |
getNodeList(Node node,
XPathExpression expression)
Evaluates the compiled XPath expression in the specified context and returns
a
NodeList . |
static <T extends Node> |
getNodes(Node node,
XPathExpression expression)
Evaluates the compiled XPath expression in the specified context and returns
a list of
Node . |
static double |
getNumber(Node node,
XPathExpression expression)
Evaluates the compiled XPath expression in the specified context and returns
a
Double . |
static String |
getString(Node node,
XPathExpression expression)
Evaluates the compiled XPath expression in the specified context and returns
a
String . |
public static boolean getBoolean(Node node, XPathExpression expression) throws XPathExpressionException
Boolean
.node
- the starting contextexpression
- the XPath expressionXPathExpressionException
- If the expression cannot be evaluated.public static <T extends Node> Optional<T> getNode(Node node, XPathExpression expression) throws XPathExpressionException
Node
.T
- expected node typenode
- the starting contextexpression
- the XPath expressionT extends Node
XPathExpressionException
- If the expression cannot be evaluated.public static <T extends Node> List<T> getNodes(Node node, XPathExpression expression) throws XPathExpressionException
Node
.T
- expected node typenode
- the starting contextexpression
- the XPath expressionT extends Node
XPathExpressionException
- If the expression cannot be evaluated.public static NodeList getNodeList(Node node, XPathExpression expression) throws XPathExpressionException
NodeList
.node
- the starting contextexpression
- the XPath expressionNodeList
XPathExpressionException
- If the expression cannot be evaluated.public static double getNumber(Node node, XPathExpression expression) throws XPathExpressionException
Double
.node
- the starting contextexpression
- the XPath expressionDouble
XPathExpressionException
- If the expression cannot be evaluated.public static String getString(Node node, XPathExpression expression) throws XPathExpressionException
String
.node
- the starting contextexpression
- the XPath expressionString
XPathExpressionException
- If the expression cannot be evaluated.Copyright © 2025. All rights reserved.