org.springframework.integration.xml.transformer
Class MarshallingTransformer

java.lang.Object
  extended by org.springframework.integration.context.IntegrationObjectSupport
      extended by org.springframework.integration.transformer.AbstractTransformer
          extended by org.springframework.integration.xml.transformer.MarshallingTransformer
All Implemented Interfaces:
BeanFactoryAware, BeanNameAware, InitializingBean, NamedComponent, Transformer

public class MarshallingTransformer
extends AbstractTransformer

An implementation of AbstractTransformer that delegates to an OXM Marshaller.


Field Summary
 
Fields inherited from class org.springframework.integration.context.IntegrationObjectSupport
logger
 
Constructor Summary
MarshallingTransformer(Marshaller marshaller)
           
MarshallingTransformer(Marshaller marshaller, ResultTransformer resultTransformer)
           
 
Method Summary
 java.lang.Object doTransform(Message<?> message)
          Subclasses must implement this method to provide the transformation logic.
 void setExtractPayload(boolean extractPayload)
          Specify whether the source Message's payload should be extracted prior to marshalling.
 void setResultFactory(ResultFactory resultFactory)
           
 
Methods inherited from class org.springframework.integration.transformer.AbstractTransformer
transform
 
Methods inherited from class org.springframework.integration.context.IntegrationObjectSupport
afterPropertiesSet, getBeanFactory, getComponentName, getComponentType, getConversionService, getTaskScheduler, onInit, setBeanFactory, setBeanName, setComponentName, setConversionService, setTaskScheduler, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MarshallingTransformer

public MarshallingTransformer(Marshaller marshaller,
                              ResultTransformer resultTransformer)
                       throws javax.xml.parsers.ParserConfigurationException
Throws:
javax.xml.parsers.ParserConfigurationException

MarshallingTransformer

public MarshallingTransformer(Marshaller marshaller)
                       throws javax.xml.parsers.ParserConfigurationException
Throws:
javax.xml.parsers.ParserConfigurationException
Method Detail

setResultFactory

public void setResultFactory(ResultFactory resultFactory)

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".


doTransform

public java.lang.Object doTransform(Message<?> message)
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 class AbstractTransformer