Spring Integration

org.springframework.integration.gateway
Class SimpleMessageMapper

java.lang.Object
  extended by org.springframework.integration.gateway.SimpleMessageMapper
All Implemented Interfaces:
InboundMessageMapper<Object>, OutboundMessageMapper<Object>

public class SimpleMessageMapper
extends Object
implements InboundMessageMapper<Object>, OutboundMessageMapper<Object>

An implementation of the InboundMessageMapper and OutboundMessageMapper strategy interfaces that maps directly to and from the Message payload instance.

Author:
Mark Fisher

Constructor Summary
SimpleMessageMapper()
           
 
Method Summary
 Object fromMessage(Message<?> message)
          Returns the Message payload (or null if the Message is null).
 Message<?> toMessage(Object object)
          Returns a Message with the given object as its payload, unless the object is already a Message in which case it will be returned as-is.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleMessageMapper

public SimpleMessageMapper()
Method Detail

fromMessage

public Object fromMessage(Message<?> message)
Returns the Message payload (or null if the Message is null).

Specified by:
fromMessage in interface OutboundMessageMapper<Object>

toMessage

public Message<?> toMessage(Object object)
Returns a Message with the given object as its payload, unless the object is already a Message in which case it will be returned as-is. If the object is null, the returned Message will also be null.

Specified by:
toMessage in interface InboundMessageMapper<Object>

Spring Integration

Copyright © 2010. All Rights Reserved.