Class JacksonMediaTypeCodec

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

@Deprecated(forRemoval=true, since="4.7") public abstract class JacksonMediaTypeCodec extends io.micronaut.json.codec.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
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    Deprecated, for removal: This API element is subject to removal in a future version.
     

    Fields inherited from class io.micronaut.json.codec.MapperMediaTypeCodec

    additionalTypes, applicationConfiguration, codecConfiguration, mediaType
  • Constructor Summary

    Constructors
    Constructor
    Description
    JacksonMediaTypeCodec(com.fasterxml.jackson.databind.ObjectMapper objectMapper, io.micronaut.runtime.ApplicationConfiguration applicationConfiguration, io.micronaut.http.codec.CodecConfiguration codecConfiguration, io.micronaut.http.MediaType mediaType)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    JacksonMediaTypeCodec(io.micronaut.context.BeanProvider<com.fasterxml.jackson.databind.ObjectMapper> objectMapperProvider, io.micronaut.runtime.ApplicationConfiguration applicationConfiguration, io.micronaut.http.codec.CodecConfiguration codecConfiguration, io.micronaut.http.MediaType mediaType)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
  • Method Summary

    Modifier and Type
    Method
    Description
    Deprecated, for removal: This API element is subject to removal in a future version.
    Create a new codec with the provided features.
    io.micronaut.json.codec.MapperMediaTypeCodec
    cloneWithFeatures(io.micronaut.json.JsonFeatures features)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    protected io.micronaut.json.codec.MapperMediaTypeCodec
    cloneWithMapper(io.micronaut.json.JsonMapper mapper)
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    <T> T
    decode(io.micronaut.core.type.Argument<T> type, com.fasterxml.jackson.databind.JsonNode node)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Decodes the given JSON node.
    com.fasterxml.jackson.databind.ObjectMapper
    Deprecated, for removal: This API element is subject to removal in a future version.
     

    Methods inherited from class io.micronaut.json.codec.MapperMediaTypeCodec

    cloneWithViewClass, decode, decode, decode, decode, decode, encode, encode, encode, encode, encode, encode, getJsonMapper, getMediaTypes, supportsType

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface io.micronaut.http.codec.MediaTypeCodec

    decode, decode, decode, decode
  • 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(io.micronaut.context.BeanProvider<com.fasterxml.jackson.databind.ObjectMapper> objectMapperProvider, io.micronaut.runtime.ApplicationConfiguration applicationConfiguration, io.micronaut.http.codec.CodecConfiguration codecConfiguration, io.micronaut.http.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, io.micronaut.runtime.ApplicationConfiguration applicationConfiguration, io.micronaut.http.codec.CodecConfiguration codecConfiguration, io.micronaut.http.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 io.micronaut.json.codec.MapperMediaTypeCodec cloneWithFeatures(io.micronaut.json.JsonFeatures features)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Overrides:
      cloneWithFeatures in class io.micronaut.json.codec.MapperMediaTypeCodec
    • 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 io.micronaut.json.codec.MapperMediaTypeCodec cloneWithMapper(io.micronaut.json.JsonMapper mapper)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      cloneWithMapper in class io.micronaut.json.codec.MapperMediaTypeCodec
    • decode

      public <T> T decode(io.micronaut.core.type.Argument<T> type, com.fasterxml.jackson.databind.JsonNode node) throws io.micronaut.http.codec.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:
      io.micronaut.http.codec.CodecException - When object cannot be decoded