public class XPathFacade extends Object
XPathBuilder helper class.
For example
XPathBuilder builder = new XPathBuilder();
Element firstElement = builder.xpath("//foo[@x='abc']").element(doc);
for how to create this facade| Constructor and Description |
|---|
XPathFacade(XPathBuilder builder,
String xpathText,
XPathExpression expression) |
| Modifier and Type | Method and Description |
|---|---|
Element |
element(Object item)
Evaluates the XPath expression on the given item and return the first Element or null
|
List<Element> |
elements(Object item)
Evaluates the XPath expression on the given item and return a list of nodes
|
String |
elementTextContent(Object item)
Returns the text content of the selected item or null if no element is found
|
XPathBuilder |
getBuilder() |
XPathExpression |
getExpression() |
String |
getXpathText() |
Node |
node(Object item)
Evaluates the XPath expression on the given item and return the first node or null
|
List<Node> |
nodes(Object item)
Evaluates the XPath expression on the given item and return a list of nodes
|
String |
toString() |
public XPathFacade(XPathBuilder builder, String xpathText, XPathExpression expression)
public Node node(Object item) throws XPathExpressionException
XPathExpressionExceptionpublic List<Node> nodes(Object item) throws XPathExpressionException
XPathExpressionExceptionpublic List<Element> elements(Object item) throws XPathExpressionException
XPathExpressionExceptionpublic Element element(Object item) throws XPathExpressionException
XPathExpressionExceptionpublic String elementTextContent(Object item) throws XPathExpressionException
XPathExpressionExceptionpublic XPathBuilder getBuilder()
public String getXpathText()
public XPathExpression getExpression()
Copyright © 2011–2014 Red Hat. All rights reserved.