use of org.mule.mvel2.integration.impl.CachedMapVariableResolverFactory in project mule by mulesoft.
the class AbstractVarAssignmentDataTypePropagatorTestCase method createMvelExpressionLanguageContext.
protected MVELExpressionLanguageContext createMvelExpressionLanguageContext(PrivilegedEvent testEvent, PrivilegedEvent.Builder builder, ParserConfiguration parserConfiguration) {
final MVELExpressionLanguageContext context = new MVELExpressionLanguageContext(parserConfiguration, muleContext);
final StaticVariableResolverFactory staticContext = new StaticVariableResolverFactory(parserConfiguration, muleContext);
final GlobalVariableResolverFactory globalContext = new GlobalVariableResolverFactory(emptyMap(), emptyMap(), parserConfiguration, muleContext);
final DelegateVariableResolverFactory innerDelegate = new DelegateVariableResolverFactory(globalContext, new VariableVariableResolverFactory(parserConfiguration, muleContext, testEvent, builder));
final DelegateVariableResolverFactory delegate = new DelegateVariableResolverFactory(staticContext, new MessageVariableResolverFactory(parserConfiguration, muleContext, testEvent, builder, innerDelegate));
context.setNextFactory(new CachedMapVariableResolverFactory(emptyMap(), delegate));
return context;
}
use of org.mule.mvel2.integration.impl.CachedMapVariableResolverFactory in project mule by mulesoft.
the class MVELExpressionLanguage method evaluateUntyped.
public <T> T evaluateUntyped(String expression, PrivilegedEvent event, PrivilegedEvent.Builder eventBuilder, ComponentLocation componentLocation, Map<String, Object> vars) {
if (event == null) {
return evaluateUntyped(expression, vars);
}
MVELExpressionLanguageContext context = createExpressionLanguageContext();
final DelegateVariableResolverFactory innerDelegate = new DelegateVariableResolverFactory(globalContext, createVariableVariableResolverFactory(event, eventBuilder));
final DelegateVariableResolverFactory delegate = new DelegateVariableResolverFactory(staticContext, new EventVariableResolverFactory(parserConfiguration, muleContext, event, eventBuilder, componentLocation, innerDelegate));
if (vars != null) {
context.setNextFactory(new CachedMapVariableResolverFactory(vars, delegate));
} else {
context.setNextFactory(delegate);
}
return evaluateInternal(expression, context);
}
use of org.mule.mvel2.integration.impl.CachedMapVariableResolverFactory in project mule by mulesoft.
the class AbstractVarExpressionDataTypeResolverTestCase method createMvelExpressionLanguageContext.
protected MVELExpressionLanguageContext createMvelExpressionLanguageContext(PrivilegedEvent testEvent, ParserConfiguration parserConfiguration) {
final MVELExpressionLanguageContext context = new MVELExpressionLanguageContext(parserConfiguration, muleContext);
final StaticVariableResolverFactory staticContext = new StaticVariableResolverFactory(parserConfiguration, muleContext);
final GlobalVariableResolverFactory globalContext = new GlobalVariableResolverFactory(Collections.EMPTY_MAP, Collections.EMPTY_MAP, parserConfiguration, muleContext);
final DelegateVariableResolverFactory innerDelegate = new DelegateVariableResolverFactory(globalContext, new VariableVariableResolverFactory(parserConfiguration, muleContext, testEvent, PrivilegedEvent.builder(testEvent)));
final DelegateVariableResolverFactory delegate = new DelegateVariableResolverFactory(staticContext, new MessageVariableResolverFactory(parserConfiguration, muleContext, testEvent, PrivilegedEvent.builder(testEvent), innerDelegate));
context.setNextFactory(new CachedMapVariableResolverFactory(Collections.EMPTY_MAP, delegate));
return context;
}
Aggregations