Class Jackson2CodecFactory

java.lang.Object
org.jwcarman.codec.jackson2.Jackson2CodecFactory
All Implemented Interfaces:
CodecFactory

public class Jackson2CodecFactory extends Object implements CodecFactory
Produces JSON codecs backed by a shared Jackson 2.x ObjectMapper.
  • Constructor Details

    • Jackson2CodecFactory

      public Jackson2CodecFactory(com.fasterxml.jackson.databind.ObjectMapper objectMapper)
      Creates a factory that uses the given mapper for all codecs it produces.
      Parameters:
      objectMapper - the mapper to serialize and deserialize with
  • Method Details

    • create

      public <T> Codec<T> create(TypeRef<T> typeRef)
      Description copied from interface: CodecFactory
      Creates a codec for the given type reference, supporting full generic types.
      Specified by:
      create in interface CodecFactory
      Type Parameters:
      T - the codec's value type
      Parameters:
      typeRef - the type to create a codec for
      Returns:
      a codec for the type