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
,ExpressionCapable
,NamedComponent
,GenericTransformer<Message<?>,Message<?>>
,Transformer
public class MarshallingTransformer extends AbstractXmlTransformer
An implementation of
AbstractTransformer
that delegates
to an OXM Marshaller
.- Author:
- Mark Fisher, Jonas Partner, Gary Russell
-
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
Constructors Constructor Description MarshallingTransformer(Marshaller marshaller)
MarshallingTransformer(Marshaller marshaller, ResultTransformer resultTransformer)
-
Method Summary
Modifier and Type Method Description Object
doTransform(Message<?> message)
Subclasses must implement this method to provide the transformation logic.String
getComponentType()
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, getComponentName, getConversionService, getExpression, getIntegrationProperties, getIntegrationProperty, getMessageBuilderFactory, getTaskScheduler, isInitialized, setApplicationContext, setBeanFactory, setBeanName, setChannelResolver, setComponentName, setConversionService, setMessageBuilderFactory, setPrimaryExpression, setTaskScheduler, toString
-
Constructor Details
-
MarshallingTransformer
public MarshallingTransformer(Marshaller marshaller, ResultTransformer resultTransformer) throws ParserConfigurationException- Throws:
ParserConfigurationException
-
MarshallingTransformer
- Throws:
ParserConfigurationException
-
-
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.
-