@Internal @Singleton public final class JacksonDatabindMapper extends java.lang.Object implements JsonMapper
JsonMapper.| Constructor and Description | 
|---|
JacksonDatabindMapper()  | 
JacksonDatabindMapper(com.fasterxml.jackson.databind.ObjectMapper objectMapper)  | 
| Modifier and Type | Method and Description | 
|---|---|
JsonMapper | 
cloneWithFeatures(JsonFeatures features)
Create a copy of this mapper with the given json features as returned by  
JsonMapper.detectFeatures(io.micronaut.core.annotation.AnnotationMetadata). | 
JsonMapper | 
cloneWithViewClass(java.lang.Class<?> viewClass)
Create a copy of this mapper with the given view class. 
 | 
org.reactivestreams.Processor<byte[],JsonNode> | 
createReactiveParser(java.util.function.Consumer<org.reactivestreams.Processor<byte[],JsonNode>> onSubscribe,
                    boolean streamArray)
Create a reactive  
Processor that accepts json bytes and parses them as JsonNodes. | 
java.util.Optional<JsonFeatures> | 
detectFeatures(AnnotationMetadata annotations)
Detect  
JsonFeatures from the given annotation data. | 
com.fasterxml.jackson.databind.ObjectMapper | 
getObjectMapper()  | 
JsonStreamConfig | 
getStreamConfig()  | 
<T> T | 
readValue(byte[] byteArray,
         Argument<T> type)
Parse and map json from the given byte array. 
 | 
<T> T | 
readValue(java.io.InputStream inputStream,
         Argument<T> type)
Parse and map json from the given stream. 
 | 
<T> T | 
readValueFromTree(JsonNode tree,
                 Argument<T> type)
Transform a  
JsonNode to a value of the given type. | 
void | 
updateValueFromTree(java.lang.Object value,
                   JsonNode tree)
Update an object from json data. 
 | 
void | 
writeValue(java.io.OutputStream outputStream,
          java.lang.Object object)
Write an object as json. 
 | 
byte[] | 
writeValueAsBytes(java.lang.Object object)
Write an object as json. 
 | 
JsonNode | 
writeValueToTree(java.lang.Object value)
Transform an object value to a json tree. 
 | 
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitreadValue, readValueFromTree@Inject @Internal public JacksonDatabindMapper(com.fasterxml.jackson.databind.ObjectMapper objectMapper)
@Internal public JacksonDatabindMapper()
@Internal public com.fasterxml.jackson.databind.ObjectMapper getObjectMapper()
public <T> T readValueFromTree(@NonNull JsonNode tree, @NonNull Argument<T> type) throws java.io.IOException
JsonMapperJsonNode to a value of the given type.readValueFromTree in interface JsonMapperT - Type variable of the return type.tree - The input json data.type - The type to deserialize.java.io.IOException@NonNull public JsonNode writeValueToTree(@Nullable java.lang.Object value) throws java.io.IOException
JsonMapperwriteValueToTree in interface JsonMappervalue - The object value to transform.java.io.IOException - If there are any mapping exceptions (e.g. illegal values).public <T> T readValue(@NonNull java.io.InputStream inputStream, @NonNull Argument<T> type) throws java.io.IOException
JsonMapperreadValue in interface JsonMapperT - Type variable of the return type.inputStream - The input data.type - The type to deserialize to.java.io.IOExceptionpublic <T> T readValue(@NonNull byte[] byteArray, @NonNull Argument<T> type) throws java.io.IOException
JsonMapperreadValue in interface JsonMapperT - Type variable of the return type.byteArray - The input data.type - The type to deserialize to.java.io.IOExceptionpublic void writeValue(@NonNull java.io.OutputStream outputStream, @Nullable java.lang.Object object) throws java.io.IOException
JsonMapperwriteValue in interface JsonMapperoutputStream - The stream to write to.object - The object to serialize.java.io.IOExceptionpublic byte[] writeValueAsBytes(@Nullable java.lang.Object object) throws java.io.IOException
JsonMapperwriteValueAsBytes in interface JsonMapperobject - The object to serialize.java.io.IOExceptionpublic void updateValueFromTree(java.lang.Object value,
                                @NonNull
                                JsonNode tree)
                         throws java.io.IOException
JsonMapperupdateValueFromTree in interface JsonMappervalue - The object to update.tree - The json data to update from.java.io.IOException - If there are any mapping exceptions (e.g. illegal values).@NonNull public JsonMapper cloneWithFeatures(@NonNull JsonFeatures features)
JsonMapperJsonMapper.detectFeatures(io.micronaut.core.annotation.AnnotationMetadata).cloneWithFeatures in interface JsonMapperfeatures - The json features to configure.@NonNull public JsonMapper cloneWithViewClass(@NonNull java.lang.Class<?> viewClass)
JsonMappercloneWithViewClass in interface JsonMapperviewClass - The view class to use for serialization and deserialization.@NonNull public JsonStreamConfig getStreamConfig()
getStreamConfig in interface JsonMapper@NonNull public org.reactivestreams.Processor<byte[],JsonNode> createReactiveParser(java.util.function.Consumer<org.reactivestreams.Processor<byte[],JsonNode>> onSubscribe, boolean streamArray)
JsonMapperProcessor that accepts json bytes and parses them as JsonNodes.createReactiveParser in interface JsonMapperonSubscribe - An additional function to invoke with this processor when the returned processor is subscribed to.streamArray - Whether to return a top-level json array as a stream of elements rather than a single array.@NonNull public java.util.Optional<JsonFeatures> detectFeatures(@NonNull AnnotationMetadata annotations)
JsonMapperJsonFeatures from the given annotation data.detectFeatures in interface JsonMapperannotations - The annotations to scan.JsonMapper.cloneWithFeatures(io.micronaut.json.JsonFeatures), or an empty optional if there were no feature
 annotations detected (or feature annotations are not supported).