Class MapMessageConverter
java.lang.Object
org.springframework.integration.support.converter.MapMessageConverter
- All Implemented Interfaces:
Aware
,BeanFactoryAware
,MessageConverter
Converts to/from a Map with 2 keys ('headers' and 'payload').
- Since:
- 3.0
- Author:
- Gary Russell, Artem Bilan
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfromMessage
(Message<?> message, Class<?> clazz) protected MessageBuilderFactory
final void
setBeanFactory
(BeanFactory beanFactory) void
setFilterHeadersInToMessage
(boolean filterHeadersInToMessage) By default all headers on Map passed totoMessage(Object, MessageHeaders)
will be mapped.void
setHeaderNames
(String... headerNames) Headers to be converted infromMessage(Message, Class)
.Message<?>
toMessage
(Object object, MessageHeaders messageHeaders)
-
Constructor Details
-
MapMessageConverter
public MapMessageConverter()
-
-
Method Details
-
setBeanFactory
- Specified by:
setBeanFactory
in interfaceBeanFactoryAware
-
getMessageBuilderFactory
-
setHeaderNames
Headers to be converted infromMessage(Message, Class)
.toMessage(Object, MessageHeaders)
will populate all headers found in the map, unlessfilterHeadersInToMessage
is true.- Parameters:
headerNames
- The header names.
-
setFilterHeadersInToMessage
public void setFilterHeadersInToMessage(boolean filterHeadersInToMessage) By default all headers on Map passed totoMessage(Object, MessageHeaders)
will be mapped. Set this property to 'true' if you wish to limit the inbound headers to those in the #headerNames.- Parameters:
filterHeadersInToMessage
- true if the headers should be filtered.
-
toMessage
- Specified by:
toMessage
in interfaceMessageConverter
-
fromMessage
- Specified by:
fromMessage
in interfaceMessageConverter
-