Spring Integration

org.springframework.integration.transformer
Class AbstractPayloadTransformer<T,U>

java.lang.Object
  extended by org.springframework.integration.context.IntegrationObjectSupport
      extended by org.springframework.integration.transformer.AbstractTransformer
          extended by org.springframework.integration.transformer.AbstractPayloadTransformer<T,U>
All Implemented Interfaces:
org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.InitializingBean, NamedComponent, Transformer
Direct Known Subclasses:
JsonToObjectTransformer, MapToObjectTransformer, ObjectToJsonTransformer, ObjectToMapTransformer, ObjectToStringTransformer, PayloadTypeConvertingTransformer, SourceCreatingTransformer, UnmarshallingTransformer

public abstract class AbstractPayloadTransformer<T,U>
extends AbstractTransformer

A base class for Transformer implementations that modify the payload of a Message. If the return value is itself a Message, it will be used as the result. Otherwise, the return value will be used as the payload of the result Message.

Author:
Mark Fisher

Field Summary
 
Fields inherited from class org.springframework.integration.context.IntegrationObjectSupport
logger
 
Constructor Summary
AbstractPayloadTransformer()
           
 
Method Summary
 U doTransform(Message<?> message)
          Subclasses must implement this method to provide the transformation logic.
protected abstract  U transformPayload(T payload)
           
 
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

AbstractPayloadTransformer

public AbstractPayloadTransformer()
Method Detail

doTransform

public final U doTransform(Message<?> message)
                    throws java.lang.Exception
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
Throws:
java.lang.Exception

transformPayload

protected abstract U transformPayload(T payload)
                               throws java.lang.Exception
Throws:
java.lang.Exception

Spring Integration