Class ExpressionEvaluatingMessageProcessor<T>
java.lang.Object
org.springframework.integration.util.AbstractExpressionEvaluator
org.springframework.integration.handler.AbstractMessageProcessor<T>
org.springframework.integration.handler.ExpressionEvaluatingMessageProcessor<T>
- All Implemented Interfaces:
org.springframework.beans.factory.Aware,org.springframework.beans.factory.BeanFactoryAware,org.springframework.beans.factory.InitializingBean,MessageProcessor<T>
public class ExpressionEvaluatingMessageProcessor<T> extends AbstractMessageProcessor<T>
A
MessageProcessor implementation that evaluates a SpEL expression
with the Message itself as the root object within the evaluation context.- Since:
- 2.0
-
Field Summary
Fields inherited from class org.springframework.integration.util.AbstractExpressionEvaluator
EXPRESSION_PARSER, logger -
Constructor Summary
Constructors Constructor Description ExpressionEvaluatingMessageProcessor(java.lang.String expression)Create anExpressionEvaluatingMessageProcessorfor the given expression.ExpressionEvaluatingMessageProcessor(java.lang.String expression, java.lang.Class<T> expectedType)ConstructExpressionEvaluatingMessageProcessorfor the provided SpEL expression and expected result type.ExpressionEvaluatingMessageProcessor(org.springframework.expression.Expression expression)Create anExpressionEvaluatingMessageProcessorfor the given expression.ExpressionEvaluatingMessageProcessor(org.springframework.expression.Expression expression, java.lang.Class<T> expectedType)Create anExpressionEvaluatingMessageProcessorfor the given expression and expected type for its evaluation result. -
Method Summary
Modifier and Type Method Description TprocessMessage(org.springframework.messaging.Message<?> message)Processes the Message by evaluating the expression with that Message as the root object.java.lang.StringtoString()Methods inherited from class org.springframework.integration.util.AbstractExpressionEvaluator
afterPropertiesSet, evaluateExpression, evaluateExpression, evaluateExpression, evaluateExpression, evaluateExpression, evaluateExpression, evaluateExpression, getBeanFactory, getEvaluationContext, getEvaluationContext, getMessageBuilderFactory, onInit, setBeanFactory, setConversionService
-
Constructor Details
-
ExpressionEvaluatingMessageProcessor
public ExpressionEvaluatingMessageProcessor(org.springframework.expression.Expression expression)Create anExpressionEvaluatingMessageProcessorfor the given expression.- Parameters:
expression- The expression.
-
ExpressionEvaluatingMessageProcessor
public ExpressionEvaluatingMessageProcessor(org.springframework.expression.Expression expression, @Nullable java.lang.Class<T> expectedType)Create anExpressionEvaluatingMessageProcessorfor the given expression and expected type for its evaluation result.- Parameters:
expression- The expression.expectedType- The expected type.
-
ExpressionEvaluatingMessageProcessor
public ExpressionEvaluatingMessageProcessor(java.lang.String expression)Create anExpressionEvaluatingMessageProcessorfor the given expression.- Parameters:
expression- a SpEL expression to evaluate.- Since:
- 5.0
-
ExpressionEvaluatingMessageProcessor
public ExpressionEvaluatingMessageProcessor(java.lang.String expression, @Nullable java.lang.Class<T> expectedType)ConstructExpressionEvaluatingMessageProcessorfor the provided SpEL expression and expected result type.- Parameters:
expression- a SpEL expression to evaluate.expectedType- the expected result type.- Since:
- 5.0
-
-
Method Details
-
processMessage
Processes the Message by evaluating the expression with that Message as the root object. The expression evaluation result Object will be returned.- Specified by:
processMessagein interfaceMessageProcessor<T>- Specified by:
processMessagein classAbstractMessageProcessor<T>- Parameters:
message- The message.- Returns:
- The result of processing the message.
-
toString
public java.lang.String toString()- Overrides:
toStringin classjava.lang.Object
-