Class Transformer

All Implemented Interfaces:
Command<ChenileExchange>

public class Transformer extends BaseChenileInterceptor
Performs a transformation from JSON to the ChenileExchange.getBodyType() mentioned in the ChenileExchange
Author:
Raja Shankar Kolluru
  • Field Details

    • om

      private final tools.jackson.databind.ObjectMapper om
  • Constructor Details

    • Transformer

      public Transformer()
  • Method Details

    • doPreProcessing

      public void doPreProcessing(ChenileExchange exchange)
      Description copied from class: BaseChenileInterceptor
      Override this to do pre-processing. This will be called before the service is invoked. Don't expect to see exception or response being set in ChenileExchange. However you can check for ChenileExchange.getBody() to manipulate the body if this interceptor is a Chenile post processor or a service specific or operation specific interceptor.
      If this interceptor is a Chenile pre-processor, then ChenileExchange.getBody() will return null. Then you need to look at headers only.
      Overrides:
      doPreProcessing in class BaseChenileInterceptor
      Parameters:
      exchange -
    • isCompatible

      private boolean isCompatible(Object value, Type targetType)
    • primitiveWrapper

      private Class<?> primitiveWrapper(Class<?> primitiveType)
    • throwBadRequestException

      private void throwBadRequestException(ChenileExchange exchange, Exception e)