Class DefaultDatatypeChannelMessageConverter
java.lang.Object
org.springframework.integration.support.converter.DefaultDatatypeChannelMessageConverter
- All Implemented Interfaces:
Aware
,BeanFactoryAware
,MessageConverter
public class DefaultDatatypeChannelMessageConverter
extends Object
implements MessageConverter, BeanFactoryAware
Default message converter for datatype channels. Registered under bean name
'datatypeChannelMessageConverter'. Delegates to the 'integrationConversionService',
if present.
- Since:
- 4.0
- Author:
- Gary Russell
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfromMessage
(Message<?> message, Class<?> targetClass) void
setBeanFactory
(BeanFactory beanFactory) void
setConversionService
(ConversionService conversionService) Specify theConversionService
to use when trying to convert to requested type.Message
<?> toMessage
(Object payload, MessageHeaders header)
-
Constructor Details
-
DefaultDatatypeChannelMessageConverter
public DefaultDatatypeChannelMessageConverter()
-
-
Method Details
-
setConversionService
Specify theConversionService
to use when trying to convert to requested type. If this property is not set explicitly but the converter is managed within a context, it will attempt to locate a bean named "integrationConversionService" defined within that context.- Parameters:
conversionService
- The conversion service.
-
setBeanFactory
- Specified by:
setBeanFactory
in interfaceBeanFactoryAware
- Throws:
BeansException
-
fromMessage
- Specified by:
fromMessage
in interfaceMessageConverter
- Returns:
- the converted payload or null if conversion is not possible.
-
toMessage
- Specified by:
toMessage
in interfaceMessageConverter
-