Class JsonSerialiserConverter<T>

  • Type Parameters:
    T - - The type to be serialised.
    All Implemented Interfaces:
    org.ikasan.spec.serialiser.Converter<T,​java.lang.String>

    public class JsonSerialiserConverter<T>
    extends java.lang.Object
    implements org.ikasan.spec.serialiser.Converter<T,​java.lang.String>
    POJO -> Json String converter implemented using Jackson.
    • Constructor Summary

      Constructors 
      Constructor Description
      JsonSerialiserConverter()
      Construct instance with a default Jackson ObjectMapper
      JsonSerialiserConverter​(com.fasterxml.jackson.databind.ObjectMapper mapper)
      Construct instance with using the provided Jackson ObjectMapper
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String convert​(T payload)
      Convert the input payload to a Json String
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • JsonSerialiserConverter

        public JsonSerialiserConverter​(com.fasterxml.jackson.databind.ObjectMapper mapper)
        Construct instance with using the provided Jackson ObjectMapper
      • JsonSerialiserConverter

        public JsonSerialiserConverter()
        Construct instance with a default Jackson ObjectMapper
    • Method Detail

      • convert

        public java.lang.String convert​(T payload)
        Convert the input payload to a Json String
        Specified by:
        convert in interface org.ikasan.spec.serialiser.Converter<T,​java.lang.String>
        Parameters:
        payload - - The object to be serialised
        Returns:
        The Json serialised object as a String
        Throws:
        org.ikasan.spec.component.transformation.TransformationException - if payload cannot be serialised