Class MVELExpressionEvaluator
- java.lang.Object
-
- org.drools.scenariosimulation.backend.expression.MVELExpressionEvaluator
-
- All Implemented Interfaces:
ExpressionEvaluator
public class MVELExpressionEvaluator extends Object implements ExpressionEvaluator
-
-
Constructor Summary
Constructors Constructor Description MVELExpressionEvaluator(ClassLoader classLoader)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected StringcleanExpression(String rawExpression)The clean works in the following ways: - NOT COLLECTIONS CASE: The given rawExpression without MVEL_ESCAPE_SYMBOL ('#'); - COLLECTION CASE: Retrieving the value from rawExpression, which is a JSON String node in this case, removing the MVEL_ESCAPE_SYMBOL ('#'); In both cases, the given String must start with MVEL_ESCAPE_SYMBOL.protected ObjectcompileAndExecute(String rawExpression, Map<String,Object> params)ObjectevaluateLiteralExpression(String rawExpression, String className, List<String> genericClasses)ExpressionEvaluatorResultevaluateUnaryExpression(String rawExpression, Object resultValue, Class<?> resultClass)StringfromObjectToExpression(Object value)
-
-
-
Constructor Detail
-
MVELExpressionEvaluator
public MVELExpressionEvaluator(ClassLoader classLoader)
-
-
Method Detail
-
evaluateUnaryExpression
public ExpressionEvaluatorResult evaluateUnaryExpression(String rawExpression, Object resultValue, Class<?> resultClass)
- Specified by:
evaluateUnaryExpressionin interfaceExpressionEvaluator
-
evaluateLiteralExpression
public Object evaluateLiteralExpression(String rawExpression, String className, List<String> genericClasses)
- Specified by:
evaluateLiteralExpressionin interfaceExpressionEvaluator
-
fromObjectToExpression
public String fromObjectToExpression(Object value)
- Specified by:
fromObjectToExpressionin interfaceExpressionEvaluator
-
compileAndExecute
protected Object compileAndExecute(String rawExpression, Map<String,Object> params)
-
cleanExpression
protected String cleanExpression(String rawExpression)
The clean works in the following ways: - NOT COLLECTIONS CASE: The given rawExpression without MVEL_ESCAPE_SYMBOL ('#'); - COLLECTION CASE: Retrieving the value from rawExpression, which is a JSON String node in this case, removing the MVEL_ESCAPE_SYMBOL ('#'); In both cases, the given String must start with MVEL_ESCAPE_SYMBOL. All other cases are wrong: aIllegalArgumentExceptionis thrown.- Parameters:
rawExpression-- Returns:
-
-