|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.tinyjee.maven.dim.utils.XPathEvaluatorImplementation
public class XPathEvaluatorImplementation
Implements XPathEvaluator
.
Field Summary | |
---|---|
static String |
DEFAULT_PREFIX
|
Constructor Summary | |
---|---|
XPathEvaluatorImplementation(Document document)
Creates a new evaluator around the given document. |
Method Summary | |
---|---|
List<Node> |
asList(NodeList nodeList)
Converts the given NodeList to a java list of Node instances. |
List<Node> |
findNodes(String xpathExpression)
Finds all DOM nodes that match the given XPath expression. |
String |
findText(String xpathExpression)
Searches the loaded document for the text content of the first node matched by the given XPath expression. |
XPathEvaluator |
newEvaluator(Node node)
Creates a new dependent evaluator that resolves nodes relative to the given node. |
String |
serialize(Node node)
Serializes the given DOM node to XML. |
static String |
serializeNode(Node node, boolean omitDeclaration, boolean standalone)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String DEFAULT_PREFIX
Constructor Detail |
---|
public XPathEvaluatorImplementation(Document document)
document
- the document to evaluate on.Method Detail |
---|
public static String serializeNode(Node node, boolean omitDeclaration, boolean standalone)
public String findText(String xpathExpression)
XPathEvaluator
findText
in interface XPathEvaluator
xpathExpression
- The xpath expression used to select the text content. E.g. "/html/head/title"
public List<Node> findNodes(String xpathExpression)
XPathEvaluator
findNodes
in interface XPathEvaluator
xpathExpression
- The xpath expression used to select nodes, E.g. //table
public String serialize(Node node)
XPathEvaluator
serialize
in interface XPathEvaluator
node
- the node to serialize.
public List<Node> asList(NodeList nodeList)
XPathEvaluator
NodeList
to a java list of Node
instances.
asList
in interface XPathEvaluator
nodeList
- the node list to convert.
public XPathEvaluator newEvaluator(Node node)
XPathEvaluator
The evaluator returned by this method shares internals like namespace resolution and xpath engine and may not be used concurrently (in multiple threads) with its creator.
newEvaluator
in interface XPathEvaluator
node
- the node to resolve against.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |