|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.commons.jexl.ExpressionImpl
class ExpressionImpl
Instances of ExpressionImpl are created by the ExpressionFactory,
and this is the default implementation of the Expression interface.
| Field Summary | |
|---|---|
protected java.lang.String |
expression
Original expression. |
protected SimpleNode |
node
The resulting AST we can call value() on. |
protected java.util.List |
postResolvers
resolvers called after expression evaluation. |
protected java.util.List |
preResolvers
resolvers called before expression evaluation. |
| Constructor Summary | |
|---|---|
ExpressionImpl(java.lang.String expr,
SimpleNode ref)
do not let this be generally instantiated with a 'new'. |
|
| Method Summary | |
|---|---|
void |
addPostResolver(JexlExprResolver resolver)
Allows addition of a resolver to allow custom interdiction of expression evaluation. |
void |
addPreResolver(JexlExprResolver resolver)
Allows addition of a resolver to allow custom interdiction of expression evaluation. |
java.lang.Object |
evaluate(JexlContext context)
Evaluates the expression with the variables contained in the supplied JexlContext. |
java.lang.String |
getExpression()
Returns the JEXL expression this Expression was created with. |
java.lang.String |
toString()
Provide a string representation of the expression. |
protected java.lang.Object |
tryResolver(java.util.List resolverList,
JexlContext context)
Tries the resolvers in the given resolverlist against the context. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected java.util.List preResolvers
protected java.util.List postResolvers
protected java.lang.String expression
protected SimpleNode node
| Constructor Detail |
|---|
ExpressionImpl(java.lang.String expr,
SimpleNode ref)
expr - the expression.ref - the parsed expression.| Method Detail |
|---|
public java.lang.Object evaluate(JexlContext context)
throws java.lang.Exception
JexlContext.
evaluate in interface Expressioncontext - A JexlContext containing variables.
java.lang.Exception - on any error
protected java.lang.Object tryResolver(java.util.List resolverList,
JexlContext context)
resolverList - list of JexlExprResolverscontext - JexlContext to use for evauluation
public java.lang.String getExpression()
getExpression in interface Expressionpublic void addPreResolver(JexlExprResolver resolver)
addPreResolver in interface Expressionresolver - resolver to be called before Jexl expression evaluatedpublic void addPostResolver(JexlExprResolver resolver)
addPostResolver in interface Expressionresolver - resolver to be called if Jexl expression
evaluated to null.public java.lang.String toString()
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||