Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.commons.jexl
Interface Expression

public interface Expression

Represents a single JEXL expression. This simple interface provides access to the underlying expression through getExpression(), and it provides hooks to add a pre- and post- expression resolver.

An expression is different than a script - it is simply a reference of an expression.

Version:
  $Id: Expression.java,v 1.7 2004/08/23 13:53:34 dion Exp $

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
`Object` | `evaluate(JexlContext context)` Evaluates the expression with the variables contained in the supplied `JexlContext`.
`String` | `getExpression()` Returns the JEXL expression this Expression was created with.

Method Detail

### evaluate

    public Object evaluate(JexlContext context)
                    throws Exception

  Evaluates the expression with the variables contained in the supplied `JexlContext`.
  Parameters:
    `context` - A JexlContext containing variables.
  Returns:
    The result of this evaluation

### getExpression

    public String getExpression()

  Returns the JEXL expression this Expression was created with.
  Returns:
    The JEXL expression to be evaluated

### addPreResolver

    public void addPreResolver(JexlExprResolver resolver)

  allows addition of a resolver to allow custom interdiction of expression evaluation
  Parameters:
    `resolver` - resolver to be called before Jexl expression evaluated

### addPostResolver

    public void addPostResolver(JexlExprResolver resolver)

  allows addition of a resolver to allow custom interdiction of expression evaluation
  Parameters:
    `resolver` - resolver to be called if Jexl expression evaluated to null

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2003-2004 The Apache Software Foundation. All Rights Reserved.