Package org.exolab.adaptx.xpath
Class XPathParser
- java.lang.Object
-
- org.exolab.adaptx.xpath.XPathParser
-
public final class XPathParser extends java.lang.ObjectThe XPath parser. Provides functionality for creating an XPathExpression from a given string representation.- Version:
- $Revision: 3633 $
- Author:
- Keith Visco, Assaf Arkin
-
-
Constructor Summary
Constructors Constructor Description XPathParser()Default constructor
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description XPathExpressioncreateExpression(java.lang.String xpath)Creates an XPath expression from the given StringXPathExpressioncreateSelectExpression(java.lang.String xpath)Creates an XPath expression that will evaluate to a NodeSet.static XPathParsernewInstance()voidsetUseErrorExpr(boolean useErrorExpr)Enables the use of an error expression.
-
-
-
Method Detail
-
createExpression
public XPathExpression createExpression(java.lang.String xpath) throws XPathException
Creates an XPath expression from the given String- Parameters:
xpath- the String to create the expression from- Throws:
XPathException
-
createSelectExpression
public XPathExpression createSelectExpression(java.lang.String xpath) throws XPathException
Creates an XPath expression that will evaluate to a NodeSet.- Parameters:
xpath- the String to create the select expression from.- Returns:
- the new expression
- Throws:
XPathException
-
newInstance
public static XPathParser newInstance()
-
setUseErrorExpr
public void setUseErrorExpr(boolean useErrorExpr)
Enables the use of an error expression. This allows suppressing syntax errors until the expression is actually evaluated. By default, an XPathException will be thrown.- Parameters:
useErrorExpr- a boolean that when true will return an ErrorExpr instead of throwing an XPathException
-
-