Package io.micronaut.jackson.databind
Class JacksonDatabindMapper
java.lang.Object
io.micronaut.jackson.databind.JacksonDatabindMapper
- All Implemented Interfaces:
io.micronaut.json.JsonMapper
@Internal
@Singleton
public final class JacksonDatabindMapper
extends Object
implements io.micronaut.json.JsonMapper
jackson-databind implementation of
JsonMapper.- Since:
- 3.1
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringProperty used to specify whether JSON view is enabled. -
Constructor Summary
ConstructorsConstructorDescriptionJacksonDatabindMapper(com.fasterxml.jackson.databind.ObjectMapper objectMapper) JacksonDatabindMapper(com.fasterxml.jackson.databind.ObjectMapper objectMapper, boolean allowViews) -
Method Summary
Modifier and TypeMethodDescription@NonNull io.micronaut.json.JsonMappercloneWithFeatures(@NonNull io.micronaut.json.JsonFeatures features) @NonNull io.micronaut.json.JsonMappercloneWithViewClass(@NonNull Class<?> viewClass) @NonNull org.reactivestreams.Processor<byte[],io.micronaut.json.tree.JsonNode> createReactiveParser(@NonNull Consumer<org.reactivestreams.Processor<byte[], io.micronaut.json.tree.JsonNode>> onSubscribe, boolean streamArray) @NonNull io.micronaut.json.JsonMappercreateSpecific(@NonNull io.micronaut.core.type.Argument<?> type) @NonNull Optional<io.micronaut.json.JsonFeatures>detectFeatures(@NonNull io.micronaut.core.annotation.AnnotationMetadata annotations) com.fasterxml.jackson.databind.ObjectMapper@NonNull io.micronaut.json.JsonStreamConfig<T> TreadValue(byte @NonNull [] byteArray, @NonNull io.micronaut.core.type.Argument<T> type) <T> TreadValue(@NonNull io.micronaut.core.io.buffer.ByteBuffer<?> byteBuffer, @NonNull io.micronaut.core.type.Argument<T> type) <T> TreadValue(@NonNull InputStream inputStream, @NonNull io.micronaut.core.type.Argument<T> type) <T> TreadValueFromTree(@NonNull io.micronaut.json.tree.JsonNode tree, @NonNull io.micronaut.core.type.Argument<T> type) voidupdateValueFromTree(Object value, @NonNull io.micronaut.json.tree.JsonNode tree) <T> voidwriteValue(@NonNull OutputStream outputStream, @NonNull io.micronaut.core.type.Argument<T> type, T object) voidwriteValue(@NonNull OutputStream outputStream, @Nullable Object object) <T> byte[]writeValueAsBytes(@NonNull io.micronaut.core.type.Argument<T> type, T object) byte[]writeValueAsBytes(@Nullable Object object) <T> @NonNull io.micronaut.json.tree.JsonNodewriteValueToTree(@NonNull io.micronaut.core.type.Argument<T> type, T value) @NonNull io.micronaut.json.tree.JsonNodewriteValueToTree(@Nullable Object value) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.micronaut.json.JsonMapper
readValue, readValue, readValue, readValue, readValueFromTree, writeValueAsString, writeValueAsString, writeValueAsString
-
Field Details
-
PROPERTY_JSON_VIEW_ENABLED
Property used to specify whether JSON view is enabled.- See Also:
-
-
Constructor Details
-
JacksonDatabindMapper
@Internal public JacksonDatabindMapper(com.fasterxml.jackson.databind.ObjectMapper objectMapper) -
JacksonDatabindMapper
@Inject @Internal public JacksonDatabindMapper(com.fasterxml.jackson.databind.ObjectMapper objectMapper, @Value("${jackson.json-view.enabled:false}") boolean allowViews) -
JacksonDatabindMapper
@Internal public JacksonDatabindMapper()
-
-
Method Details
-
getObjectMapper
@Internal public com.fasterxml.jackson.databind.ObjectMapper getObjectMapper() -
createSpecific
@NonNull public @NonNull io.micronaut.json.JsonMapper createSpecific(@NonNull @NonNull io.micronaut.core.type.Argument<?> type) - Specified by:
createSpecificin interfaceio.micronaut.json.JsonMapper
-
readValueFromTree
public <T> T readValueFromTree(@NonNull @NonNull io.micronaut.json.tree.JsonNode tree, @NonNull @NonNull io.micronaut.core.type.Argument<T> type) throws IOException - Specified by:
readValueFromTreein interfaceio.micronaut.json.JsonMapper- Throws:
IOException
-
writeValueToTree
@NonNull public @NonNull io.micronaut.json.tree.JsonNode writeValueToTree(@Nullable @Nullable Object value) throws IOException - Specified by:
writeValueToTreein interfaceio.micronaut.json.JsonMapper- Throws:
IOException
-
writeValueToTree
@NonNull public <T> @NonNull io.micronaut.json.tree.JsonNode writeValueToTree(@NonNull @NonNull io.micronaut.core.type.Argument<T> type, T value) throws IOException - Specified by:
writeValueToTreein interfaceio.micronaut.json.JsonMapper- Throws:
IOException
-
readValue
public <T> T readValue(@NonNull @NonNull InputStream inputStream, @NonNull @NonNull io.micronaut.core.type.Argument<T> type) throws IOException - Specified by:
readValuein interfaceio.micronaut.json.JsonMapper- Throws:
IOException
-
readValue
public <T> T readValue(byte @NonNull [] byteArray, @NonNull @NonNull io.micronaut.core.type.Argument<T> type) throws IOException - Specified by:
readValuein interfaceio.micronaut.json.JsonMapper- Throws:
IOException
-
readValue
public <T> T readValue(@NonNull @NonNull io.micronaut.core.io.buffer.ByteBuffer<?> byteBuffer, @NonNull @NonNull io.micronaut.core.type.Argument<T> type) throws IOException - Specified by:
readValuein interfaceio.micronaut.json.JsonMapper- Throws:
IOException
-
writeValue
public void writeValue(@NonNull @NonNull OutputStream outputStream, @Nullable @Nullable Object object) throws IOException - Specified by:
writeValuein interfaceio.micronaut.json.JsonMapper- Throws:
IOException
-
writeValue
public <T> void writeValue(@NonNull @NonNull OutputStream outputStream, @NonNull @NonNull io.micronaut.core.type.Argument<T> type, T object) throws IOException - Specified by:
writeValuein interfaceio.micronaut.json.JsonMapper- Throws:
IOException
-
writeValueAsBytes
- Specified by:
writeValueAsBytesin interfaceio.micronaut.json.JsonMapper- Throws:
IOException
-
writeValueAsBytes
public <T> byte[] writeValueAsBytes(@NonNull @NonNull io.micronaut.core.type.Argument<T> type, T object) throws IOException - Specified by:
writeValueAsBytesin interfaceio.micronaut.json.JsonMapper- Throws:
IOException
-
updateValueFromTree
public void updateValueFromTree(Object value, @NonNull @NonNull io.micronaut.json.tree.JsonNode tree) throws IOException - Specified by:
updateValueFromTreein interfaceio.micronaut.json.JsonMapper- Throws:
IOException
-
cloneWithFeatures
@NonNull public @NonNull io.micronaut.json.JsonMapper cloneWithFeatures(@NonNull @NonNull io.micronaut.json.JsonFeatures features) - Specified by:
cloneWithFeaturesin interfaceio.micronaut.json.JsonMapper
-
cloneWithViewClass
@NonNull public @NonNull io.micronaut.json.JsonMapper cloneWithViewClass(@NonNull @NonNull Class<?> viewClass) - Specified by:
cloneWithViewClassin interfaceio.micronaut.json.JsonMapper
-
getStreamConfig
@NonNull public @NonNull io.micronaut.json.JsonStreamConfig getStreamConfig()- Specified by:
getStreamConfigin interfaceio.micronaut.json.JsonMapper
-
createReactiveParser
@NonNull public @NonNull org.reactivestreams.Processor<byte[],io.micronaut.json.tree.JsonNode> createReactiveParser(@NonNull @NonNull Consumer<org.reactivestreams.Processor<byte[], io.micronaut.json.tree.JsonNode>> onSubscribe, boolean streamArray) - Specified by:
createReactiveParserin interfaceio.micronaut.json.JsonMapper
-
detectFeatures
@NonNull public @NonNull Optional<io.micronaut.json.JsonFeatures> detectFeatures(@NonNull @NonNull io.micronaut.core.annotation.AnnotationMetadata annotations) - Specified by:
detectFeaturesin interfaceio.micronaut.json.JsonMapper
-