Class DecodingTransformer<T>

java.lang.Object
Type Parameters:
T - the 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

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

    • DecodingTransformer

      public DecodingTransformer​(Codec codec, java.lang.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, org.springframework.expression.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​(org.springframework.expression.spel.support.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​(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.