public class XPathFacade
extends java.lang.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,
java.lang.String xpathText,
javax.xml.xpath.XPathExpression expression) |
| Modifier and Type | Method and Description |
|---|---|
org.w3c.dom.Element |
element(java.lang.Object item)
Evaluates the XPath expression on the given item and return the first Element or null
|
java.util.List<org.w3c.dom.Element> |
elements(java.lang.Object item)
Evaluates the XPath expression on the given item and return a list of nodes
|
java.lang.String |
elementTextContent(java.lang.Object item)
Returns the text content of the selected item or null if no element is found
|
XPathBuilder |
getBuilder() |
javax.xml.xpath.XPathExpression |
getExpression() |
java.lang.String |
getXpathText() |
org.w3c.dom.Node |
node(java.lang.Object item)
Evaluates the XPath expression on the given item and return the first node or null
|
java.util.List<org.w3c.dom.Node> |
nodes(java.lang.Object item)
Evaluates the XPath expression on the given item and return a list of nodes
|
java.lang.String |
toString() |
public XPathFacade(XPathBuilder builder, java.lang.String xpathText, javax.xml.xpath.XPathExpression expression)
public java.lang.String toString()
toString in class java.lang.Objectpublic org.w3c.dom.Node node(java.lang.Object item)
throws javax.xml.xpath.XPathExpressionException
javax.xml.xpath.XPathExpressionExceptionpublic java.util.List<org.w3c.dom.Node> nodes(java.lang.Object item)
throws javax.xml.xpath.XPathExpressionException
javax.xml.xpath.XPathExpressionExceptionpublic java.util.List<org.w3c.dom.Element> elements(java.lang.Object item)
throws javax.xml.xpath.XPathExpressionException
javax.xml.xpath.XPathExpressionExceptionpublic org.w3c.dom.Element element(java.lang.Object item)
throws javax.xml.xpath.XPathExpressionException
javax.xml.xpath.XPathExpressionExceptionpublic java.lang.String elementTextContent(java.lang.Object item)
throws javax.xml.xpath.XPathExpressionException
javax.xml.xpath.XPathExpressionExceptionpublic XPathBuilder getBuilder()
public java.lang.String getXpathText()
public javax.xml.xpath.XPathExpression getExpression()
Copyright © 2014 Red Hat. All Rights Reserved.