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
XPathExpressionException
public List<Node> nodes(Object item) throws XPathExpressionException
XPathExpressionException
public List<Element> elements(Object item) throws XPathExpressionException
XPathExpressionException
public Element element(Object item) throws XPathExpressionException
XPathExpressionException
public String elementTextContent(Object item) throws XPathExpressionException
XPathExpressionException
public XPathBuilder getBuilder()
public String getXpathText()
public XPathExpression getExpression()
Copyright © 2011–2015 Red Hat. All rights reserved.