Spring Integration

org.springframework.integration.handler
Class ExpressionEvaluatingMessageProcessor

java.lang.Object
  extended by org.springframework.integration.handler.AbstractMessageProcessor
      extended by org.springframework.integration.handler.ExpressionEvaluatingMessageProcessor
All Implemented Interfaces:
BeanFactoryAware, MessageProcessor

public class ExpressionEvaluatingMessageProcessor
extends AbstractMessageProcessor
implements BeanFactoryAware

A MessageProcessor implementation that evaluates a SpEL expression with the Message itself as the root object within the evaluation context.

Since:
2.0
Author:
Mark Fisher

Constructor Summary
ExpressionEvaluatingMessageProcessor(String expression)
          Create an ExpressionEvaluatingMessageProcessor for the given expression String.
 
Method Summary
 Object processMessage(Message<?> message)
          Processes the Message by evaluating the expression with that Message as the root object.
 void setBeanFactory(BeanFactory beanFactory)
          Specify a BeanFactory in order to enable resolution via @beanName in the expression.
 void setExpectedType(Class<?> expectedType)
          Set the result type expected from evaluation of the expression.
 
Methods inherited from class org.springframework.integration.handler.AbstractMessageProcessor
evaluateExpression, getEvaluationContext, setConversionService
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExpressionEvaluatingMessageProcessor

public ExpressionEvaluatingMessageProcessor(String expression)
Create an ExpressionEvaluatingMessageProcessor for the given expression String.

Method Detail

setExpectedType

public void setExpectedType(Class<?> expectedType)
Set the result type expected from evaluation of the expression.


setBeanFactory

public void setBeanFactory(BeanFactory beanFactory)
Specify a BeanFactory in order to enable resolution via @beanName in the expression.

Specified by:
setBeanFactory in interface BeanFactoryAware

processMessage

public Object processMessage(Message<?> message)
Processes the Message by evaluating the expression with that Message as the root object. The expression evaluation result Object will be returned.

Specified by:
processMessage in interface MessageProcessor

Spring Integration

Copyright © 2010. All Rights Reserved.