Class DecodingTransformer<T>

Type Parameters:
T - the payload type.
All Implemented Interfaces:
Aware, BeanFactoryAware, BeanNameAware, InitializingBean, ApplicationContextAware, ExpressionCapable, GenericTransformer<Message<?>,Message<?>>, NamedComponent, Transformer

public class DecodingTransformer<T> extends AbstractTransformer
AbstractPayloadTransformer that delegates to a codec to decode the payload from a byte[].
Since:
4.2
Author:
Gary Russell
  • Constructor Details

    • DecodingTransformer

      public DecodingTransformer(Codec codec, Class<T> type)
      Construct an instance to use the supplied codec to decode to the supplied type.
      Parameters:
      codec - the codec.
      type - the type.
    • DecodingTransformer

      public DecodingTransformer(Codec codec, Expression typeExpression)
      Construct an instance to use the supplied codec to decode to the supplied type.
      Parameters:
      codec - the codec.
      typeExpression - an expression that evaluates to a Class.
  • Method Details

    • setEvaluationContext

      public void setEvaluationContext(StandardEvaluationContext evaluationContext)
    • onInit

      protected void onInit()
      Description copied from class: IntegrationObjectSupport
      Subclasses may implement this for initialization logic.
      Overrides:
      onInit in class IntegrationObjectSupport
    • doTransform

      protected T 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.