org.apache.commons.jelly.expression

## Interface Expression

All Known Implementing Classes:
  CompositeExpression, ConstantExpression, EscapingExpression, ExpressionSupport, JexlExpression, XPathExpression

    public interface Expression

`Expression` represents an arbitrary expression using some pluggable expression language.

Version:
  $Revision: 155420 $
Author:
  James Strachan

### Field Summary

Fields
`static Expression` `NULL` Singleton instance that represents the expression that evaluates to null.

### Method Summary

Methods
`java.lang.Object` `evaluate(JellyContext context)` Evaluates the expression with the given context and returns the result
`boolean` `evaluateAsBoolean(JellyContext context)` Evaluates the expression with the given context coercing the result to be a boolean.
`java.util.Iterator` `evaluateAsIterator(JellyContext context)` Evaluates the expression with the given context coercing the result to be an Iterator.
`java.lang.String` `evaluateAsString(JellyContext context)` Evaluates the expression with the given context coercing the result to be a String.
`java.lang.Object` `evaluateRecurse(JellyContext context)` This method evaluates the expression until a value (a non-Expression) object is returned.
`java.lang.String` `getExpressionText()`

### Field Detail

#### NULL

    static final Expression NULL

Singleton instance that represents the expression that evaluates to null.

### Method Detail

#### getExpressionText

    java.lang.String getExpressionText()

Returns:
  the textual representation of this expression

#### evaluate

    java.lang.Object evaluate(JellyContext context)

Evaluates the expression with the given context and returns the result

#### evaluateAsString

    java.lang.String evaluateAsString(JellyContext context)

Evaluates the expression with the given context coercing the result to be a String.

#### evaluateAsBoolean

    boolean evaluateAsBoolean(JellyContext context)

Evaluates the expression with the given context coercing the result to be a boolean.

#### evaluateAsIterator

    java.util.Iterator evaluateAsIterator(JellyContext context)

Evaluates the expression with the given context coercing the result to be an Iterator.

#### evaluateRecurse

    java.lang.Object evaluateRecurse(JellyContext context)

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.