diff --git a/spring-integration-core/src/main/java/org/springframework/integration/handler/ExpressionEvaluatingMessageProcessor.java b/spring-integration-core/src/main/java/org/springframework/integration/handler/ExpressionEvaluatingMessageProcessor.java index b201f31096..cf85907536 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/handler/ExpressionEvaluatingMessageProcessor.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/handler/ExpressionEvaluatingMessageProcessor.java @@ -45,6 +45,7 @@ public class ExpressionEvaluatingMessageProcessor extends AbstractMessageProc this(expression, null); } + /** * Create an {@link ExpressionEvaluatingMessageProcessor} for the given expression String. */ @@ -61,13 +62,6 @@ public class ExpressionEvaluatingMessageProcessor extends AbstractMessageProc } - /** - * Set the result type expected from evaluation of the expression. - */ -// public void setExpectedType(Class expectedType) { -// this.expectedType = expectedType; -// } - /** * Processes the Message by evaluating the expression with that Message as the * root object. The expression evaluation result Object will be returned. diff --git a/spring-integration-core/src/main/java/org/springframework/integration/util/AbstractExpressionEvaluator.java b/spring-integration-core/src/main/java/org/springframework/integration/util/AbstractExpressionEvaluator.java index ff61fda853..f06606b329 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/util/AbstractExpressionEvaluator.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/util/AbstractExpressionEvaluator.java @@ -43,28 +43,30 @@ public abstract class AbstractExpressionEvaluator implements BeanFactoryAware { private final BeanFactoryTypeConverter typeConverter = new BeanFactoryTypeConverter(); + public AbstractExpressionEvaluator() { - evaluationContext.setTypeConverter(typeConverter); - evaluationContext.addPropertyAccessor(new MapAccessor()); + this.evaluationContext.setTypeConverter(this.typeConverter); + this.evaluationContext.addPropertyAccessor(new MapAccessor()); } + /** * Specify a BeanFactory in order to enable resolution via @beanName in the expression. */ public void setBeanFactory(final BeanFactory beanFactory) { if (beanFactory != null) { - typeConverter.setBeanFactory(beanFactory); + this.typeConverter.setBeanFactory(beanFactory); this.getEvaluationContext().setBeanResolver(new SimpleBeanResolver(beanFactory)); } } public void setConversionService(ConversionService conversionService) { if (conversionService != null) { - typeConverter.setConversionService(conversionService); + this.typeConverter.setConversionService(conversionService); } } - // TODO: does this need to be public? + // TODO: should we make this protected (would require changes to tests only) public StandardEvaluationContext getEvaluationContext() { return this.evaluationContext; } @@ -85,15 +87,15 @@ public abstract class AbstractExpressionEvaluator implements BeanFactoryAware { } protected Object evaluateExpression(String expression, Object input) { - return evaluateExpression(expression, input, (Class) null); + return this.evaluateExpression(expression, input, (Class) null); } protected T evaluateExpression(String expression, Object input, Class expectedType) { - return expressionParser.parseExpression(expression).getValue(this.evaluationContext, input, expectedType); + return this.expressionParser.parseExpression(expression).getValue(this.evaluationContext, input, expectedType); } protected Object evaluateExpression(Expression expression, Object input) { - return evaluateExpression(expression, input, (Class) null); + return this.evaluateExpression(expression, input, (Class) null); } protected T evaluateExpression(Expression expression, Object input, Class expectedType) {