org.springframework.integration.message
Class MethodParameterMessageMapper

java.lang.Object
  extended by org.springframework.integration.message.MethodParameterMessageMapper
All Implemented Interfaces:
InboundMessageMapper<java.lang.Object[]>, OutboundMessageMapper<java.lang.Object[]>

public class MethodParameterMessageMapper
extends java.lang.Object
implements InboundMessageMapper<java.lang.Object[]>, OutboundMessageMapper<java.lang.Object[]>

Prepares arguments for handler methods. The method parameters are matched against the Message, its payload as well as its headers. A message or payload parameter must not be annotated, and there can be at most one of these. In certain special cases, more than one non-annotated parameter can be used (more on this later), but there should always be at most one parameter that is expecting the message or its payload.

If a method parameter is annotated with @Header, the annotation's value will be used as a header name. If such an annotation contains no value, then the parameter name will be used as long as the information is available in the class file (requires compilation with debug settings for parameter names).

In addition a Map or Properties parameter can receive multiple message headers. In the case of a Map argument, all headers will be passed, but in the case of a Properties argument, only the headers with String-typed values will be passed. These parameters can be labeled explicitly with the @Headers annotation, or matched implicitly by using a non- ambiguous method signature. There can be as many parameters annotated with

Author:
Mark Fisher, Iwein Fuld

Constructor Summary
MethodParameterMessageMapper(java.lang.reflect.Method method)
           
 
Method Summary
 java.lang.Object[] fromMessage(Message<?> message)
           
 Message<?> toMessage(java.lang.Object[] parameters)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MethodParameterMessageMapper

public MethodParameterMessageMapper(java.lang.reflect.Method method)
Method Detail

toMessage

public Message<?> toMessage(java.lang.Object[] parameters)
Specified by:
toMessage in interface InboundMessageMapper<java.lang.Object[]>

fromMessage

public java.lang.Object[] fromMessage(Message<?> message)
Specified by:
fromMessage in interface OutboundMessageMapper<java.lang.Object[]>