Class ExpressionSupport
- java.lang.Object
-
- org.apache.commons.jelly.expression.ExpressionSupport
-
- All Implemented Interfaces:
Expression
- Direct Known Subclasses:
CompositeExpression
,ConstantExpression
,EscapingExpression
,JexlExpression
,XPathExpression
public abstract class ExpressionSupport extends Object implements Expression
ExpressionSupport
an abstract base class for Expression implementations which provides default implementations of some of the typesafe evaluation methods.- Version:
- $Revision: 155420 $
- Author:
- James Strachan
-
-
Field Summary
Fields Modifier and Type Field Description protected static Iterator
EMPTY_ITERATOR
-
Fields inherited from interface org.apache.commons.jelly.expression.Expression
NULL
-
-
Constructor Summary
Constructors Constructor Description ExpressionSupport()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
evaluateAsBoolean(JellyContext context)
Evaluates the expression with the given context coercing the result to be a boolean.Iterator
evaluateAsIterator(JellyContext context)
Evaluates the expression with the given context coercing the result to be an Iterator.String
evaluateAsString(JellyContext context)
Evaluates the expression with the given context coercing the result to be a String.Object
evaluateRecurse(JellyContext context)
This method evaluates the expression until a value (a non-Expression) object is returned.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.commons.jelly.expression.Expression
evaluate, getExpressionText
-
-
-
-
Field Detail
-
EMPTY_ITERATOR
protected static final Iterator EMPTY_ITERATOR
-
-
Method Detail
-
evaluateAsString
public String evaluateAsString(JellyContext context)
Description copied from interface:Expression
Evaluates the expression with the given context coercing the result to be a String.- Specified by:
evaluateAsString
in interfaceExpression
-
evaluateRecurse
public Object evaluateRecurse(JellyContext context)
Description copied from interface:Expression
This method evaluates the expression until a value (a non-Expression) object is returned. If the expression returns another expression, then the nested expression is evaluated.Sometimes when Jelly is used inside Maven the value of an expression can actually be another expression. For example if a properties file is read, the values of variables can actually be expressions themselves.
e.g. ${foo.bar} can lookup "foo.bar" in a Maven context which could actually be another expression.
So using this method, nested expressions can be evaluated to the actual underlying value object.
- Specified by:
evaluateRecurse
in interfaceExpression
-
evaluateAsBoolean
public boolean evaluateAsBoolean(JellyContext context)
Description copied from interface:Expression
Evaluates the expression with the given context coercing the result to be a boolean.- Specified by:
evaluateAsBoolean
in interfaceExpression
-
evaluateAsIterator
public Iterator evaluateAsIterator(JellyContext context)
Description copied from interface:Expression
Evaluates the expression with the given context coercing the result to be an Iterator.- Specified by:
evaluateAsIterator
in interfaceExpression
-
-