use of org.springframework.expression.spel.support.SimpleEvaluationContext in project spring-integration by spring-projects.
the class IntegrationSimpleEvaluationContextFactoryBean method getObject.
@Override
public SimpleEvaluationContext getObject() throws Exception {
Collection<PropertyAccessor> accessors = getPropertyAccessors().values();
PropertyAccessor[] accessorArray = accessors.toArray(new PropertyAccessor[accessors.size() + 2]);
accessorArray[accessors.size()] = new MapAccessor();
accessorArray[accessors.size() + 1] = DataBindingPropertyAccessor.forReadOnlyAccess();
SimpleEvaluationContext evaluationContext = SimpleEvaluationContext.forPropertyAccessors(accessorArray).withTypeConverter(getTypeConverter()).withInstanceMethods().build();
for (Entry<String, Method> functionEntry : getFunctions().entrySet()) {
evaluationContext.setVariable(functionEntry.getKey(), functionEntry.getValue());
}
return evaluationContext;
}
Aggregations