/** * Constructor for SpringELExpression. * * @param expression a parsed Spring EL expression instance. Must not be null. * @param expressionVars provides a mapping between variables names and * parsed Spring EL expression instances. * This parameter is optional (may be null). * @param expectedType the target type expected from the evaluation of the expression or null. * This parameter is optional (may be null). * @param conversionService the Spring ConversionService instance to use for type conversion * @param propertyAccessors propertyAccessors for Spring EL to use when evaluating expressions */ public SpringELExpression(org.springframework.expression.Expression expression, Map<String, Expression> expressionVars, Class<?> expectedType, ConversionService conversionService, List<PropertyAccessor> propertyAccessors) { this(expression, expectedType, new StandardEvaluationContextFactory(propertyAccessors, conversionService, expressionVars)); }
@Override public EvaluationContext createContext(Object rootObject) { StandardEvaluationContext context = new StandardEvaluationContext(rootObject); context.setVariables(getVariableValues(rootObject)); context.setTypeConverter(new StandardTypeConverter(conversionService)); context.getPropertyAccessors().addAll(propertyAccessors); return context; }
@Override public EvaluationContext createContext(Object rootObject) { StandardEvaluationContext context = new StandardEvaluationContext(rootObject); context.setVariables(getVariableValues(rootObject)); context.setTypeConverter(new StandardTypeConverter(conversionService)); context.getPropertyAccessors().addAll(propertyAccessors); return context; }
/** * Constructor for SpringELExpression. * * @param expression a parsed Spring EL expression instance. Must not be null. * @param expressionVars provides a mapping between variables names and * parsed Spring EL expression instances. * This parameter is optional (may be null). * @param expectedType the target type expected from the evaluation of the expression or null. * This parameter is optional (may be null). * @param conversionService the Spring ConversionService instance to use for type conversion * @param propertyAccessors propertyAccessors for Spring EL to use when evaluating expressions */ public SpringELExpression(org.springframework.expression.Expression expression, Map<String, Expression> expressionVars, Class<?> expectedType, ConversionService conversionService, List<PropertyAccessor> propertyAccessors) { this(expression, expectedType, new StandardEvaluationContextFactory(propertyAccessors, conversionService, expressionVars)); }