org.milyn.expression
Class MVELExpressionEvaluator

java.lang.Object
  extended by org.milyn.expression.MVELExpressionEvaluator
All Implemented Interfaces:
ExpressionEvaluator

public class MVELExpressionEvaluator
extends Object
implements ExpressionEvaluator

MVEL expression evaluator.

Author:
tom.fennelly@gmail.com

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.milyn.expression.ExpressionEvaluator
ExpressionEvaluator.Factory
 
Constructor Summary
MVELExpressionEvaluator()
           
 
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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MVELExpressionEvaluator

public MVELExpressionEvaluator()
Method Detail

setExpression

public void setExpression(String expression)
                   throws SmooksConfigurationException
Description copied from interface: ExpressionEvaluator
Set the condition expression for the evaluator implementation.

Specified by:
setExpression in interface ExpressionEvaluator
Parameters:
expression - The expression to be evaluated by the evaluator implementation.
Throws:
SmooksConfigurationException - Invalid expression configuration.

getExpression

public String getExpression()
Description copied from interface: ExpressionEvaluator
Get the String representation of the active expression on the evaluator instance.

Specified by:
getExpression in interface ExpressionEvaluator
Returns:
The active expression String representation.

eval

public boolean eval(Object contextObject)
             throws ExpressionEvaluationException
Description copied from interface: ExpressionEvaluator
Evaluate a conditional expression against the supplied object (can be a Map).

Specified by:
eval in interface ExpressionEvaluator
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

public Object getValue(Object contextObject)
                throws ExpressionEvaluationException
Description copied from interface: ExpressionEvaluator
Evaluate an expression against the supplied Map variable, returning the eval result.

Specified by:
getValue in interface ExpressionEvaluator
Returns:
Expression evaluation result.
Throws:
ExpressionEvaluationException - Invalid expression evaluation (implementation specific).


Copyright © 2008. All Rights Reserved.