org.exolab.adaptx.xpath

Interface XPathExpression

public interface XPathExpression

Interface representing an XPath expression. An XPath expression is thread-safe and can be evaluated multiple times concurrently. It is a compiled version of the textual XPath expression and can be cached for later use.

Version: $Revision: 3738 $

Author: Keith Visco Assaf Arkin

Field Summary
static shortBOOLEAN
The Boolean expression type.
static shortERROR
Expression of type error.
static shortFILTER_EXPR
The FilterExpr expression type.
static shortLOCATION_PATH
The LocationPath expression type.
static shortNODE_TEST
The NodeTest expressions type
static shortNUMBER
The NodeTest expressions type
static shortPATH_EXPR
The PathExpr expression type.
static shortPRIMARY
The Primary expression type.
static shortSTEP
The Step expression type.
static shortSTRING
The String expression type.
static shortUNION_EXPR
The union expression type.
Method Summary
XPathResultevaluate(XPathContext context)
Evaluates the expression and returns the XPath result.
shortgetExprType()
Returns the type of this expression.
StringtoString()
Returns the XPath expression as a string.

Field Detail

BOOLEAN

public static final short BOOLEAN
The Boolean expression type.

ERROR

public static final short ERROR
Expression of type error.

FILTER_EXPR

public static final short FILTER_EXPR
The FilterExpr expression type.

LOCATION_PATH

public static final short LOCATION_PATH
The LocationPath expression type.

NODE_TEST

public static final short NODE_TEST
The NodeTest expressions type

NUMBER

public static final short NUMBER
The NodeTest expressions type

PATH_EXPR

public static final short PATH_EXPR
The PathExpr expression type.

PRIMARY

public static final short PRIMARY
The Primary expression type.

STEP

public static final short STEP
The Step expression type.

STRING

public static final short STRING
The String expression type.

UNION_EXPR

public static final short UNION_EXPR
The union expression type.

Method Detail

evaluate

public XPathResult evaluate(XPathContext context)
Evaluates the expression and returns the XPath result.

Parameters: context The XPathContext to use during evaluation.

Returns: The XPathResult (not null).

Throws: XPathException if an error occured while evaluating this expression.

getExprType

public short getExprType()
Returns the type of this expression.

Returns: The type of this expression

toString

public String toString()
Returns the XPath expression as a string. The returned value is a valid XPath expression that can be parsed into an equivalent XPathExpression object.

Returns: The XPath expression as a string