Class AbstractPayloadTransformer<T,​U>

java.lang.Object
Type Parameters:
T - inbound payload type.
U - outbound payload type.
All Implemented Interfaces:
org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.InitializingBean, org.springframework.context.ApplicationContextAware, ExpressionCapable, NamedComponent, GenericTransformer<org.springframework.messaging.Message<?>,​org.springframework.messaging.Message<?>>, Transformer
Direct Known Subclasses:
EncodingPayloadTransformer, MapToObjectTransformer, ObjectToMapTransformer, ObjectToStringTransformer, PayloadTypeConvertingTransformer, SyslogToMapTransformer

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.
  • Constructor Details

  • Method Details

    • doTransform

      public final U doTransform​(org.springframework.messaging.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.
    • transformPayload

      protected abstract U transformPayload​(T payload)