|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjd.xml.xpath.tool.XPath
A utility class to evaluate XPath expressions.
Constructor Summary | |
XPath(Expression expr)
Create a XPath object for the given Expression. |
|
XPath(String expr)
Create a XPath object for the given Expression string. |
|
XPath(String expr,
XPathNamespaces namespaces)
Create a XPath object for the given Expression string. |
Method Summary | |
void |
clearVariable(String name)
Clear a variable value. |
void |
clearVariables()
Clear the variable values. |
XPathContext |
getContext()
Return the evaluation context. |
Expression |
getExpression()
Return the parsed XPath expression. |
static void |
main(String[] args)
|
void |
printResult(XObject result,
XmlWriter out)
|
void |
printVerboseResult(XObject result,
XmlWriter out)
|
static int |
run(String[] args)
|
void |
setContext(XPathNode contextNode)
Set the evaluation context: The context nodes is set to the given node, the context size and position is set to 1. |
void |
setVariable(String name,
boolean value)
Set a variable to a boolean value. |
void |
setVariable(String name,
double value)
Set a variable to a number value. |
void |
setVariable(String name,
String value)
Set a variable to a String value. |
void |
setVariable(String name,
XObject value)
Set a variable to a generic value. |
boolean |
toBooleanValue()
Evaluate the expression to a boolean value. |
XNodeSet |
toNodeSet()
Evaluate the expression to a node-set. |
double |
toNumberValue()
Evaluate the expression to a number value. |
String |
toStringValue()
Evaluate the expression to a String value. |
XObject |
toXObject()
Evaluate the expression to a generic XPath object. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public XPath(String expr) throws XPathParseException
XPathParseException
- if the expression string
cannot be parsed.public XPath(String expr, XPathNamespaces namespaces) throws XPathParseException
XPathParseException
- if the expression string
cannot be parsed.public XPath(Expression expr)
Method Detail |
public Expression getExpression()
public void setVariable(String name, boolean value)
public void setVariable(String name, String value)
public void setVariable(String name, double value)
public void setVariable(String name, XObject value)
public void clearVariables()
public void clearVariable(String name)
public void setContext(XPathNode contextNode)
public XPathContext getContext()
public boolean toBooleanValue()
public String toStringValue()
public double toNumberValue()
public XNodeSet toNodeSet()
public XObject toXObject()
public void printVerboseResult(XObject result, XmlWriter out)
public void printResult(XObject result, XmlWriter out) throws IOException
IOException
public static int run(String[] args) throws Exception
Exception
public static void main(String[] args) throws Exception
Exception
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |