org.exolab.adaptx.xpath
Interface XPathExpression

All Known Subinterfaces:
BinaryExpr, EqualityExpr, FilterExpr, GroupedExpression, LocationStep, NodeExpression, PathComponent
All Known Implementing Classes:
AbstractPathComponent, BooleanFunctionCall, Concat, Contains, CountFunctionCall, ErrorExpr, ErrorFunctionCall, ExtensionFunctionCall, FalseFunctionCall, FormatNumber, FunctionCall, FunctionCallImpl, IdFunctionCall, IdRefFunctionCall, LangFunctionCall, LastFunctionCall, Normalize, NotFunctionCall, NumberFunctionCall, PathExpr, PositionFunctionCall, PredicateExpr, PrimaryExpr, SelectExpr, StartsWith, StringFunctionCall, StringLength, Substring, SubstringAfter, SubstringBefore, SumFunctionCall, TextFunctionCall, Translate, TrueFunctionCall, UnionExpr, VariableReference, XMLNamesFunctionCall

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 short BOOLEAN
          The Boolean expression type.
static short ERROR
          Expression of type error.
static short FILTER_EXPR
          The FilterExpr expression type.
static short LOCATION_PATH
          The LocationPath expression type.
static short NODE_TEST
          The NodeTest expressions type
static short NUMBER
          The NodeTest expressions type
static short PATH_EXPR
          The PathExpr expression type.
static short PRIMARY
          The Primary expression type.
static short STEP
          The Step expression type.
static short STRING
          The String expression type.
static short UNION_EXPR
          The union expression type.
 
Method Summary
 XPathResult evaluate(XPathContext context)
          Evaluates the expression and returns the XPath result.
 short getExprType()
          Returns the type of this expression.
 java.lang.String toString()
          Returns the XPath expression as a string.
 

Field Detail

ERROR

static final short ERROR
Expression of type error.

See Also:
Constant Field Values

BOOLEAN

static final short BOOLEAN
The Boolean expression type.

See Also:
Constant Field Values

FILTER_EXPR

static final short FILTER_EXPR
The FilterExpr expression type.

See Also:
Constant Field Values

LOCATION_PATH

static final short LOCATION_PATH
The LocationPath expression type.

See Also:
Constant Field Values

NODE_TEST

static final short NODE_TEST
The NodeTest expressions type

See Also:
Constant Field Values

NUMBER

static final short NUMBER
The NodeTest expressions type

See Also:
Constant Field Values

PATH_EXPR

static final short PATH_EXPR
The PathExpr expression type.

See Also:
Constant Field Values

PRIMARY

static final short PRIMARY
The Primary expression type.

See Also:
Constant Field Values

STEP

static final short STEP
The Step expression type.

See Also:
Constant Field Values

STRING

static final short STRING
The String expression type.

See Also:
Constant Field Values

UNION_EXPR

static final short UNION_EXPR
The union expression type.

See Also:
Constant Field Values
Method Detail

getExprType

short getExprType()
Returns the type of this expression.

Returns:
The type of this expression

evaluate

XPathResult evaluate(XPathContext context)
                     throws XPathException
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.

toString

java.lang.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.

Overrides:
toString in class java.lang.Object
Returns:
The XPath expression as a string