Class ExpressionEvaluatorFactory
- java.lang.Object
-
- org.drools.scenariosimulation.backend.expression.ExpressionEvaluatorFactory
-
public class ExpressionEvaluatorFactory extends java.lang.ObjectFactory to obtain specific expression evaluator based on context. It works like a delegate that hides part of context so it will be possible to distribute the factory and then obtain the specific expression evaluator instance only when all the information are available
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ExpressionEvaluatorFactorycreate(java.lang.ClassLoader classLoader, org.drools.scenariosimulation.api.model.ScenarioSimulationModel.Type type)ExpressionEvaluatorgetOrCreate(org.drools.scenariosimulation.api.model.FactMappingValue factMappingValue)Based on factMappingValue information it returns an instance of the specific expression evaluator required.protected booleanisAnMVELExpression(java.lang.String rawValue)A rawValue is an MVEL expression if: - NOT COLLECTIONS CASE: It's aStringwhich starts with MVEL_ESCAPE_SYMBOL ('#') - COLLECTION CASE: It's a JSON String node, which is used only when an expression is set (in other cases it's a JSON Object (Map) or a JSON Array (List)) and it's value starts with MVEL_ESCAPE_SYMBOL ('#')
-
-
-
Method Detail
-
create
public static ExpressionEvaluatorFactory create(java.lang.ClassLoader classLoader, org.drools.scenariosimulation.api.model.ScenarioSimulationModel.Type type)
-
getOrCreate
public ExpressionEvaluator getOrCreate(org.drools.scenariosimulation.api.model.FactMappingValue factMappingValue)
Based on factMappingValue information it returns an instance of the specific expression evaluator required.- Parameters:
factMappingValue-- Returns:
-
isAnMVELExpression
protected boolean isAnMVELExpression(java.lang.String rawValue)
A rawValue is an MVEL expression if: - NOT COLLECTIONS CASE: It's aStringwhich starts with MVEL_ESCAPE_SYMBOL ('#') - COLLECTION CASE: It's a JSON String node, which is used only when an expression is set (in other cases it's a JSON Object (Map) or a JSON Array (List)) and it's value starts with MVEL_ESCAPE_SYMBOL ('#')- Parameters:
rawValue-- Returns:
-
-