org.milyn.expression
Interface ExpressionEvaluator

All Known Subinterfaces:
ExecutionContextExpressionEvaluator
All Known Implementing Classes:
MVELExpressionEvaluator

public interface ExpressionEvaluator

Abstract expression evaluator interface.

Author:
tom.fennelly@gmail.com

Nested Class Summary
static class ExpressionEvaluator.Factory
          Factory method for creating ExpressionEvaluator instances.
 
Method Summary
 boolean eval(Object contextObject)
          Evaluate a conditional expression against the supplied object (can be a Map).
 String getExpression()
          Get the String representation of the active expression on the evaluator instance.
 Object getValue(Object contextObject)
          Evaluate an expression against the supplied Map variable, returning the eval result.
 void setExpression(String expression)
          Set the condition expression for the evaluator implementation.
 

Method Detail

setExpression

void setExpression(String expression)
                   throws SmooksConfigurationException
Set the condition expression for the evaluator implementation.

Parameters:
expression - The expression to be evaluated by the evaluator implementation.
Throws:
SmooksConfigurationException - Invalid expression configuration.

getExpression

String getExpression()
Get the String representation of the active expression on the evaluator instance.

Returns:
The active expression String representation.

eval

boolean eval(Object contextObject)
             throws ExpressionEvaluationException
Evaluate a conditional expression against the supplied object (can be a Map).

Parameters:
contextObject - The object against which the expression is to be evaluated.
Returns:
True if the expression evaluates to true, otherwise false.
Throws:
ExpressionEvaluationException - Invalid expression evaluation condition (implementation specific).

getValue

Object getValue(Object contextObject)
                throws ExpressionEvaluationException
Evaluate an expression against the supplied Map variable, returning the eval result.

Parameters:
contextObject -
Returns:
Expression evaluation result.
Throws:
ExpressionEvaluationException - Invalid expression evaluation (implementation specific).


Copyright © 2008. All Rights Reserved.