Class MarshallingTransformer

All Implemented Interfaces:
Aware, BeanFactoryAware, BeanNameAware, InitializingBean, ApplicationContextAware, ExpressionCapable, GenericTransformer<Message<?>,Message<?>>, NamedComponent, Transformer

public class MarshallingTransformer extends AbstractXmlTransformer
An implementation of AbstractTransformer that delegates to an OXM Marshaller.
Author:
Mark Fisher, Jonas Partner, Gary Russell, Artem Bilan
  • Constructor Details

    • MarshallingTransformer

      public MarshallingTransformer(Marshaller marshaller, ResultTransformer resultTransformer)
    • MarshallingTransformer

      public MarshallingTransformer(Marshaller marshaller)
  • 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

      public String getComponentType()
      Description copied from class: IntegrationObjectSupport
      Subclasses may implement this method to provide component type information.
      Specified by:
      getComponentType in interface NamedComponent
      Overrides:
      getComponentType in class IntegrationObjectSupport
    • 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
      Parameters:
      message - The message.
      Returns:
      The result of the transformation.