org.apache.commons.jxpath.ri.compiler

Class ExpressionPath


public class ExpressionPath
extends Path

An element of the parse tree that represents an expression path, which is a path that starts with an expression like a function call: getFoo(.) /bar.
Version:
$Revision: 1.11 $ $Date: 2004/02/29 14:17:39 $
Author:
Dmitri Plotnikov

Nested Class Summary

Nested classes/interfaces inherited from class org.apache.commons.jxpath.ri.compiler.Expression

Expression.PointerIterator, Expression.ValueIterator

Field Summary

Fields inherited from class org.apache.commons.jxpath.ri.compiler.Expression

NOT_A_NUMBER, ONE, ZERO

Constructor Summary

ExpressionPath(Expression expression, Expression[] predicates, Step[] steps)

Method Summary

Object
compute(EvalContext context)
boolean
computeContextDependent()
Returns true if the root expression or any of the predicates or the path steps are context dependent.
Object
computeValue(EvalContext context)
protected Object
expressionPath(EvalContext evalContext, boolean firstMatch)
Walks an expression path (a path that starts with an expression)
Expression
getExpression()
Expression[]
getPredicates()
Predicates are the expressions in brackets that may follow the root expression of the path.
boolean
isSimpleExpressionPath()
Recognized paths formatted as $x[3]/foo[2].
String
toString()

Methods inherited from class org.apache.commons.jxpath.ri.compiler.Path

areBasicPredicates, computeContextDependent, createContextForStep, evalSteps, getSingleNodePointerForSteps, getSteps, isSimplePath, isSimpleStep

Methods inherited from class org.apache.commons.jxpath.ri.compiler.Expression

compute, computeContextDependent, computeValue, isContextDependent, iterate, iteratePointers

Constructor Details

ExpressionPath

public ExpressionPath(Expression expression,
                      Expression[] predicates,
                      Step[] steps)

Method Details

compute

public Object compute(EvalContext context)
Overrides:
compute in interface Expression

computeContextDependent

public boolean computeContextDependent()
Returns true if the root expression or any of the predicates or the path steps are context dependent.
Overrides:
computeContextDependent in interface Path

computeValue

public Object computeValue(EvalContext context)
Overrides:
computeValue in interface Expression

expressionPath

protected Object expressionPath(EvalContext evalContext,
                                boolean firstMatch)
Walks an expression path (a path that starts with an expression)

getExpression

public Expression getExpression()

getPredicates

public Expression[] getPredicates()
Predicates are the expressions in brackets that may follow the root expression of the path.

isSimpleExpressionPath

public boolean isSimpleExpressionPath()
Recognized paths formatted as $x[3]/foo[2]. The evaluation of such "simple" paths is optimized and streamlined.

toString

public String toString()