Class JacksonMediaTypeCodec

java.lang.Object
io.micronaut.json.codec.MapperMediaTypeCodec
io.micronaut.jackson.codec.JacksonMediaTypeCodec
All Implemented Interfaces:
MediaTypeCodec
Direct Known Subclasses:
JsonMediaTypeCodec

@Deprecated(forRemoval=true, since="4.7") public abstract class JacksonMediaTypeCodec extends MapperMediaTypeCodec
Deprecated, for removal: This API element is subject to removal in a future version.
Replaced with message body writers / readers API
A MediaTypeCodec for JSON and Jackson.

Note: will be replaced by MapperMediaTypeCodec in the future, but that class is currently experimental.

Since:
1.0.0
Author:
Graeme Rocher
  • Field Details

    • REGULAR_JSON_MEDIA_TYPE_CODEC_NAME

      public static final String REGULAR_JSON_MEDIA_TYPE_CODEC_NAME
      Deprecated, for removal: This API element is subject to removal in a future version.
      See Also:
  • Constructor Details

    • JacksonMediaTypeCodec

      public JacksonMediaTypeCodec(BeanProvider<com.fasterxml.jackson.databind.ObjectMapper> objectMapperProvider, ApplicationConfiguration applicationConfiguration, CodecConfiguration codecConfiguration, MediaType mediaType)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • JacksonMediaTypeCodec

      public JacksonMediaTypeCodec(com.fasterxml.jackson.databind.ObjectMapper objectMapper, ApplicationConfiguration applicationConfiguration, CodecConfiguration codecConfiguration, MediaType mediaType)
      Deprecated, for removal: This API element is subject to removal in a future version.
  • Method Details

    • getObjectMapper

      public com.fasterxml.jackson.databind.ObjectMapper getObjectMapper()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns:
      The object mapper
    • cloneWithFeatures

      public MapperMediaTypeCodec cloneWithFeatures(JsonFeatures features)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from class: MapperMediaTypeCodec
      Create a copy of this codec with the given features. Should not be extended, extend MapperMediaTypeCodec.cloneWithMapper(io.micronaut.json.JsonMapper) instead.
      Overrides:
      cloneWithFeatures in class MapperMediaTypeCodec
      Parameters:
      features - The features to apply.
      Returns:
      A new codec with the features applied, leaving this codec unchanged.
    • cloneWithFeatures

      public abstract JacksonMediaTypeCodec cloneWithFeatures(JacksonFeatures jacksonFeatures)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Create a new codec with the provided features.
      Parameters:
      jacksonFeatures - The jackson features
      Returns:
      The new codec
    • cloneWithMapper

      protected MapperMediaTypeCodec cloneWithMapper(JsonMapper mapper)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      cloneWithMapper in class MapperMediaTypeCodec
    • decode

      public <T> T decode(Argument<T> type, com.fasterxml.jackson.databind.JsonNode node) throws CodecException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Decodes the given JSON node.
      Type Parameters:
      T - The generic type
      Parameters:
      type - The type
      node - The Json Node
      Returns:
      The decoded object
      Throws:
      CodecException - When object cannot be decoded