public interface ObjectMapper
extends io.micronaut.json.JsonMapper
JsonMapper with customizations.| Modifier and Type | Method and Description |
|---|---|
default io.micronaut.json.JsonMapper |
cloneWithFeatures(io.micronaut.json.JsonFeatures features) |
default <T> T |
readValue(byte[] byteArray,
java.lang.Class<T> type)
Read a value from the byte array for the given type.
|
default <T> T |
readValue(java.io.InputStream inputStream,
java.lang.Class<T> type)
Read a value from the given input stream for the given type.
|
default <T> T |
readValue(java.lang.String string,
java.lang.Class<T> type)
Read a value from the given string for the given type.
|
default <T> java.lang.String |
writeValueAsString(io.micronaut.core.type.Argument<T> type,
T object)
Write the given value as a string.
|
default <T> java.lang.String |
writeValueAsString(io.micronaut.core.type.Argument<T> type,
T object,
java.nio.charset.Charset charset)
Write the given value as a string.
|
default <T> java.lang.String |
writeValueAsString(T object)
Write the given value as a string.
|
cloneWithViewClass, createReactiveParser, detectFeatures, getStreamConfig, readValue, readValue, readValue, readValueFromTree, readValueFromTree, updateValueFromTree, writeValue, writeValue, writeValueAsBytes, writeValueAsBytes, writeValueToTree, writeValueToTree@Nullable
default <T> T readValue(@NonNull
java.io.InputStream inputStream,
@NonNull
java.lang.Class<T> type)
throws java.io.IOException
T - The generic typeinputStream - The input streamtype - The typenull if it decodes to nulljava.io.IOException - If an unrecoverable error occurs@Nullable
default <T> T readValue(@NonNull
byte[] byteArray,
@NonNull
java.lang.Class<T> type)
throws java.io.IOException
T - The generic typebyteArray - The byte arraytype - The typenull if it decodes to nulljava.io.IOException - If an unrecoverable error occurs@Nullable
default <T> T readValue(@NonNull
java.lang.String string,
@NonNull
java.lang.Class<T> type)
throws java.io.IOException
T - The generic typestring - The stringtype - The typenull if it decodes to nulljava.io.IOException - If an unrecoverable error occurs@NonNull
default <T> java.lang.String writeValueAsString(@NonNull
T object)
throws java.io.IOException
T - The generic typeobject - The objectjava.io.IOException - If an unrecoverable error occursdefault io.micronaut.json.JsonMapper cloneWithFeatures(io.micronaut.json.JsonFeatures features)
cloneWithFeatures in interface io.micronaut.json.JsonMapper@NonNull
default <T> java.lang.String writeValueAsString(@NonNull
io.micronaut.core.type.Argument<T> type,
@Nullable
T object)
throws java.io.IOException
T - The generic typetype - The type, never nullobject - The objectjava.io.IOException - If an unrecoverable error occurs@NonNull
default <T> java.lang.String writeValueAsString(@NonNull
io.micronaut.core.type.Argument<T> type,
@Nullable
T object,
java.nio.charset.Charset charset)
throws java.io.IOException
T - The generic typetype - The type, never nullobject - The objectcharset - The charset, never nulljava.io.IOException - If an unrecoverable error occurs