Class MarshallingTransformer
java.lang.Object
org.springframework.integration.context.IntegrationObjectSupport
org.springframework.integration.transformer.AbstractTransformer
org.springframework.integration.xml.transformer.AbstractXmlTransformer
org.springframework.integration.xml.transformer.MarshallingTransformer
- All Implemented Interfaces:
Aware
,BeanFactoryAware
,BeanNameAware
,InitializingBean
,ApplicationContextAware
,ComponentSourceAware
,ExpressionCapable
,GenericTransformer<Message<?>,
,Message<?>> NamedComponent
,Transformer
An implementation of
AbstractTransformer
that delegates
to an OXM Marshaller
.- Author:
- Mark Fisher, Jonas Partner, Gary Russell, Artem Bilan
-
Field Summary
Fields inherited from class org.springframework.integration.xml.transformer.AbstractXmlTransformer
DOM_RESULT, STRING_RESULT
Fields inherited from class org.springframework.integration.context.IntegrationObjectSupport
EXPRESSION_PARSER, logger
-
Constructor Summary
ConstructorDescriptionMarshallingTransformer
(Marshaller marshaller) MarshallingTransformer
(Marshaller marshaller, ResultTransformer resultTransformer) -
Method Summary
Modifier and TypeMethodDescriptiondoTransform
(Message<?> message) Subclasses must implement this method to provide the transformation logic.Subclasses may implement this method to provide component type information.void
setExtractPayload
(boolean extractPayload) Specify whether the source Message's payload should be extracted prior to marshalling.Methods inherited from class org.springframework.integration.xml.transformer.AbstractXmlTransformer
getResultFactory, getResultFactoryName, getResultType, onInit, setResultFactory, setResultFactoryName, setResultType
Methods inherited from class org.springframework.integration.transformer.AbstractTransformer
transform
Methods inherited from class org.springframework.integration.context.IntegrationObjectSupport
afterPropertiesSet, extractTypeIfPossible, generateId, getApplicationContext, getApplicationContextId, getBeanDescription, getBeanFactory, getBeanName, getChannelResolver, getComponentDescription, getComponentName, getComponentSource, getConversionService, getExpression, getIntegrationProperties, getMessageBuilderFactory, getTaskScheduler, isInitialized, setApplicationContext, setBeanFactory, setBeanName, setChannelResolver, setComponentDescription, setComponentName, setComponentSource, setConversionService, setMessageBuilderFactory, setPrimaryExpression, setTaskScheduler, toString
-
Constructor Details
-
MarshallingTransformer
-
MarshallingTransformer
-
-
Method Details
-
setExtractPayload
public void setExtractPayload(boolean extractPayload) Specify whether the source Message's payload should be extracted prior to marshalling. This value is set to "true" by default. To send the Message itself as input to the Marshaller instead, set this to "false".- Parameters:
extractPayload
- true if the payload should be extracted.
-
getComponentType
Description copied from class:IntegrationObjectSupport
Subclasses may implement this method to provide component type information.- Specified by:
getComponentType
in interfaceNamedComponent
- Overrides:
getComponentType
in classIntegrationObjectSupport
-
doTransform
Description copied from class:AbstractTransformer
Subclasses must implement this method to provide the transformation logic. If the return value is itself a Message, it will be used as the result. Otherwise, any non-null return value will be used as the payload of the result Message.- Specified by:
doTransform
in classAbstractTransformer
- Parameters:
message
- The message.- Returns:
- The result of the transformation.
-