org.exolab.adaptx.xpath

Interface XPathExpression

Known Subinterfaces:
BinaryExpr, EqualityExpr, LocationStep, NodeExpression, PathComponent
Known Implementing Classes:
BooleanFunctionCall, Concat, Contains, CountFunctionCall, ErrorExpr, ErrorFunctionCall, ExtensionFunctionCall, FalseFunctionCall, FilterBase, FormatNumber, FunctionCall, FunctionCallImpl, IdFunctionCall, IdRefFunctionCall, LangFunctionCall, LastFunctionCall, Normalize, NotFunctionCall, NumberFunctionCall, PathExpr, PositionFunctionCall, PredicateExpr, PrimaryExpr, PrimaryExpr, SelectExpr, StartsWith, StringFunctionCall, StringLength, Substring, SubstringAfter, SubstringBefore, SumFunctionCall, TextFunctionCall, Translate, TrueFunctionCall, UnionExpr, 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: 1.2 $
Authors:
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.
String
toString()
Returns the XPath expression as a string.

Field Details

BOOLEAN

public static final short BOOLEAN
The Boolean expression type.
Field Value:
0

ERROR

public static final short ERROR
Expression of type error.
Field Value:
-1

FILTER_EXPR

public static final short FILTER_EXPR
The FilterExpr expression type.
Field Value:
1

LOCATION_PATH

public static final short LOCATION_PATH
The LocationPath expression type.
Field Value:
2

NODE_TEST

public static final short NODE_TEST
The NodeTest expressions type
Field Value:
3

NUMBER

public static final short NUMBER
The NodeTest expressions type
Field Value:
4

PATH_EXPR

public static final short PATH_EXPR
The PathExpr expression type.
Field Value:
5

PRIMARY

public static final short PRIMARY
The Primary expression type.
Field Value:
6

STEP

public static final short STEP
The Step expression type.
Field Value:
7

STRING

public static final short STRING
The String expression type.
Field Value:
8

UNION_EXPR

public static final short UNION_EXPR
The union expression type.
Field Value:
9

Method Details

evaluate

public 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.

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