Spring Integration

org.springframework.integration.xml.transformer
Class MarshallingTransformer

java.lang.Object
  extended by org.springframework.integration.transformer.AbstractTransformer
      extended by org.springframework.integration.xml.transformer.MarshallingTransformer
All Implemented Interfaces:
Transformer

public class MarshallingTransformer
extends AbstractTransformer

An implementation of AbstractTransformer that delegates to an OXM Marshaller.

Author:
Mark Fisher, Jonas Partner

Constructor Summary
MarshallingTransformer(Marshaller marshaller)
           
MarshallingTransformer(Marshaller marshaller, ResultTransformer resultTransformer)
           
 
Method Summary
 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 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MarshallingTransformer

public MarshallingTransformer(Marshaller marshaller,
                              ResultTransformer resultTransformer)
                       throws ParserConfigurationException
Throws:
ParserConfigurationException

MarshallingTransformer

public MarshallingTransformer(Marshaller marshaller)
                       throws ParserConfigurationException
Throws:
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 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

Spring Integration

Copyright © 2010. All Rights Reserved.