org.springframework.integration.support.converter
Class MapMessageConverter
java.lang.Object
org.springframework.integration.support.converter.MapMessageConverter
- All Implemented Interfaces:
- MessageConverter
public class MapMessageConverter
- extends java.lang.Object
- implements MessageConverter
Converts to/from a Map with 2 keys ('headers' and 'payload').
- Since:
- 3.0
- Author:
- Gary Russell
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MapMessageConverter
public MapMessageConverter()
setHeaderNames
public void setHeaderNames(java.lang.String... headerNames)
- Headers to be converted in
fromMessage(Message)
.
toMessage(Object)
will populate all headers found in
the map, unless filterHeadersInToMessage
is true.
- Parameters:
headerNames
-
setFilterHeadersInToMessage
public void setFilterHeadersInToMessage(boolean filterHeadersInToMessage)
- By default all headers on Map passed to
toMessage(Object)
will be mapped. Set this property
to 'true' if you wish to limit the inbound headers to those in
the #headerNames.
- Parameters:
filterHeadersInToMessage
-
toMessage
public <P> Message<P> toMessage(java.lang.Object object)
- Specified by:
toMessage
in interface MessageConverter
fromMessage
public <P> java.lang.Object fromMessage(Message<P> message)
- Specified by:
fromMessage
in interface MessageConverter