Package io.micronaut.jackson.codec
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 Summary
Modifier and TypeFieldDescriptionstatic 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
ConstructorDescriptionJacksonMediaTypeCodec
(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.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. -
Method Summary
Modifier and TypeMethodDescriptionabstract 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.cloneWithFeatures
(JsonFeatures features) Deprecated, for removal: This API element is subject to removal in a future version.Create a copy of this codec with the given features.protected MapperMediaTypeCodec
cloneWithMapper
(JsonMapper mapper) Deprecated, for removal: This API element is subject to removal in a future version.<T> T
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
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
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, extendMapperMediaTypeCodec.cloneWithMapper(io.micronaut.json.JsonMapper)
instead.- Overrides:
cloneWithFeatures
in classMapperMediaTypeCodec
- Parameters:
features
- The features to apply.- Returns:
- A new codec with the features applied, leaving this codec unchanged.
-
cloneWithFeatures
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
Deprecated, for removal: This API element is subject to removal in a future version.- Specified by:
cloneWithMapper
in classMapperMediaTypeCodec
-
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 typenode
- The Json Node- Returns:
- The decoded object
- Throws:
CodecException
- When object cannot be decoded
-