org.exolab.adaptx.xpath

Class XPathParser


public final class XPathParser
extends java.lang.Object

The XPath parser. Provides functionality for creating an XPathExpression from a given string representation.
Version:
$Revision: 3633 $
Authors:
Keith Visco
Assaf Arkin

Constructor Summary

XPathParser()
Default constructor

Method Summary

XPathExpression
createExpression(String xpath)
Creates an XPath expression from the given String
XPathExpression
createSelectExpression(String xpath)
Creates an XPath expression that will evaluate to a NodeSet.
static XPathParser
newInstance()
void
setUseErrorExpr(boolean useErrorExpr)
Enables the use of an error expression.

Constructor Details

XPathParser

public XPathParser()
Default constructor

Method Details

createExpression

public XPathExpression createExpression(String xpath)
            throws XPathException
Creates an XPath expression from the given String
Parameters:
xpath - the String to create the expression from

createSelectExpression

public XPathExpression createSelectExpression(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

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