Package io.micronaut.jackson.codec
Class JsonMediaTypeCodec
java.lang.Object
io.micronaut.json.codec.MapperMediaTypeCodec
io.micronaut.jackson.codec.JacksonMediaTypeCodec
io.micronaut.jackson.codec.JsonMediaTypeCodec
- All Implemented Interfaces:
MediaTypeCodec
- Direct Known Subclasses:
JsonStreamMediaTypeCodec
@Named("json")
@Singleton
@Secondary
@Bean(typed={JsonMediaTypeCodec.class,JacksonMediaTypeCodec.class})
public class JsonMediaTypeCodec
extends JacksonMediaTypeCodec
A
MediaTypeCodec
for JSON and Jackson.
Note: will be replaced by JsonMediaTypeCodec
in the future, but that class is
currently experimental.- Since:
- 1.0.0
- Author:
- Graeme Rocher
-
Field Summary
Fields inherited from class io.micronaut.jackson.codec.JacksonMediaTypeCodec
REGULAR_JSON_MEDIA_TYPE_CODEC_NAME
Fields inherited from class io.micronaut.json.codec.MapperMediaTypeCodec
additionalTypes, applicationConfiguration, codecConfiguration, mediaType
-
Constructor Summary
ConstructorDescriptionJsonMediaTypeCodec
(com.fasterxml.jackson.databind.ObjectMapper objectMapper, ApplicationConfiguration applicationConfiguration, @Nullable CodecConfiguration codecConfiguration) JsonMediaTypeCodec
(BeanProvider<com.fasterxml.jackson.databind.ObjectMapper> objectMapper, ApplicationConfiguration applicationConfiguration, @Nullable CodecConfiguration codecConfiguration) -
Method Summary
Modifier and TypeMethodDescriptioncloneWithFeatures
(JacksonFeatures jacksonFeatures) Create a new codec with the provided features.Methods inherited from class io.micronaut.jackson.codec.JacksonMediaTypeCodec
cloneWithFeatures, cloneWithMapper, decode, getObjectMapper
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
-
CONFIGURATION_QUALIFIER
- See Also:
-
-
Constructor Details
-
JsonMediaTypeCodec
public JsonMediaTypeCodec(com.fasterxml.jackson.databind.ObjectMapper objectMapper, ApplicationConfiguration applicationConfiguration, @Named("json") @Nullable @Nullable CodecConfiguration codecConfiguration) - Parameters:
objectMapper
- To read/write JSONapplicationConfiguration
- The common application configurationscodecConfiguration
- The configuration for the codec
-
JsonMediaTypeCodec
@Inject public JsonMediaTypeCodec(BeanProvider<com.fasterxml.jackson.databind.ObjectMapper> objectMapper, ApplicationConfiguration applicationConfiguration, @Named("json") @Nullable @Nullable CodecConfiguration codecConfiguration) - Parameters:
objectMapper
- To read/write JSONapplicationConfiguration
- The common application configurationscodecConfiguration
- The configuration for the codec
-
-
Method Details
-
cloneWithFeatures
Description copied from class:JacksonMediaTypeCodec
Create a new codec with the provided features.- Specified by:
cloneWithFeatures
in classJacksonMediaTypeCodec
- Parameters:
jacksonFeatures
- The jackson features- Returns:
- The new codec
-