Package org.smooks.engine.expression
Class MVELExpressionEvaluator
- java.lang.Object
-
- org.smooks.engine.expression.MVELExpressionEvaluator
-
- All Implemented Interfaces:
ExpressionEvaluator
public class MVELExpressionEvaluator extends Object implements ExpressionEvaluator
MVEL expression evaluator.- Author:
- tom.fennelly@gmail.com, maurice@zeijen.net
-
-
Constructor Summary
Constructors Constructor Description MVELExpressionEvaluator()MVELExpressionEvaluator(String expression)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleaneval(Object contextObject)Evaluate a conditional expression against the supplied object (can be a Map).Objectexec(Object contextObject)Objectexec(Object contextObject, Map<String,Object> variableMap)SerializablegetCompiled()StringgetExpression()Get the String representation of the active expression on the evaluator instance.ObjectgetValue(Object contextObject)Evaluate an expression against the supplied Map variable, returning the eval result.ExpressionEvaluatorsetExpression(String expression)Set the condition expression for the evaluator implementation.voidsetToType(Class<?> toType)StringtoString()
-
-
-
Constructor Detail
-
MVELExpressionEvaluator
public MVELExpressionEvaluator()
-
MVELExpressionEvaluator
public MVELExpressionEvaluator(String expression)
-
-
Method Detail
-
setExpression
public ExpressionEvaluator setExpression(String expression) throws SmooksConfigException
Description copied from interface:ExpressionEvaluatorSet the condition expression for the evaluator implementation.- Specified by:
setExpressionin interfaceExpressionEvaluator- Parameters:
expression- The expression to be evaluated by the evaluator implementation.- Throws:
SmooksConfigException- Invalid expression configuration.
-
getExpression
public String getExpression()
Description copied from interface:ExpressionEvaluatorGet the String representation of the active expression on the evaluator instance.- Specified by:
getExpressionin interfaceExpressionEvaluator- Returns:
- The active expression String representation.
-
setToType
public void setToType(Class<?> toType)
-
eval
public boolean eval(Object contextObject) throws ExpressionEvaluationException
Description copied from interface:ExpressionEvaluatorEvaluate a conditional expression against the supplied object (can be a Map).- Specified by:
evalin interfaceExpressionEvaluator- 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).
-
exec
public Object exec(Object contextObject, Map<String,Object> variableMap) throws ExpressionEvaluationException
- Throws:
ExpressionEvaluationException
-
exec
public Object exec(Object contextObject) throws ExpressionEvaluationException
- Throws:
ExpressionEvaluationException
-
getValue
public Object getValue(Object contextObject) throws ExpressionEvaluationException
Description copied from interface:ExpressionEvaluatorEvaluate an expression against the supplied Map variable, returning the eval result.- Specified by:
getValuein interfaceExpressionEvaluator- Returns:
- Expression evaluation result.
- Throws:
ExpressionEvaluationException- Invalid expression evaluation (implementation specific).
-
getCompiled
public Serializable getCompiled()
- Returns:
- the compiled
-
-