Class JacksonJsonMapper

java.lang.Object
io.micronaut.serde.jackson.JacksonJsonMapper
All Implemented Interfaces:
io.micronaut.json.JsonMapper, ObjectMapper

@Internal @Singleton @Primary public final class JacksonJsonMapper extends Object implements ObjectMapper
Implementation of the JsonMapper interface for Jackson.
  • Constructor Details

  • Method Details

    • cloneWithConfiguration

      public ObjectMapper cloneWithConfiguration(@Nullable @Nullable SerdeConfiguration configuration, @Nullable @Nullable SerializationConfiguration serializationConfiguration, @Nullable @Nullable DeserializationConfiguration deserializationConfiguration)
      Description copied from interface: ObjectMapper
      Optional feature. Create a new ObjectMapper with the given configuration values. A null parameter indicates the old configuration should be used.
      Specified by:
      cloneWithConfiguration in interface ObjectMapper
      Parameters:
      configuration - The SerdeConfiguration
      serializationConfiguration - The SerializationConfiguration
      deserializationConfiguration - The DeserializationConfiguration
      Returns:
      A new JsonMapper with the updated config
    • 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:
      readValueFromTree in interface io.micronaut.json.JsonMapper
      Throws:
      IOException
    • writeValueToTree

      @NonNull public @NonNull io.micronaut.json.tree.JsonNode writeValueToTree(@Nullable @Nullable Object value) throws IOException
      Specified by:
      writeValueToTree in interface io.micronaut.json.JsonMapper
      Throws:
      IOException
    • writeValueToTree

      public <T> io.micronaut.json.tree.JsonNode writeValueToTree(io.micronaut.core.type.Argument<T> type, T value) throws IOException
      Specified by:
      writeValueToTree in interface io.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:
      readValue in interface io.micronaut.json.JsonMapper
      Throws:
      IOException
    • readValue

      public <T> T readValue(@NonNull @io.micronaut.core.annotation.NonNull byte[] byteArray, @NonNull @NonNull io.micronaut.core.type.Argument<T> type) throws IOException
      Specified by:
      readValue in interface io.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:
      readValue in interface io.micronaut.json.JsonMapper
      Throws:
      IOException
    • writeValue

      public void writeValue(@NonNull @NonNull OutputStream outputStream, @Nullable @Nullable Object object) throws IOException
      Specified by:
      writeValue in interface io.micronaut.json.JsonMapper
      Throws:
      IOException
    • writeValue

      public <T> void writeValue(OutputStream outputStream, io.micronaut.core.type.Argument<T> type, T object) throws IOException
      Specified by:
      writeValue in interface io.micronaut.json.JsonMapper
      Throws:
      IOException
    • writeValueAsBytes

      public byte[] writeValueAsBytes(@Nullable @Nullable Object object) throws IOException
      Specified by:
      writeValueAsBytes in interface io.micronaut.json.JsonMapper
      Throws:
      IOException
    • writeValueAsBytes

      public <T> byte[] writeValueAsBytes(io.micronaut.core.type.Argument<T> type, T object) throws IOException
      Specified by:
      writeValueAsBytes in interface io.micronaut.json.JsonMapper
      Throws:
      IOException
    • getStreamConfig

      @NonNull public @NonNull io.micronaut.json.JsonStreamConfig getStreamConfig()
      Specified by:
      getStreamConfig in interface io.micronaut.json.JsonMapper
    • createReactiveParser

      @NonNull public @NonNull org.reactivestreams.Processor<byte[],io.micronaut.json.tree.JsonNode> createReactiveParser(Consumer<org.reactivestreams.Processor<byte[],io.micronaut.json.tree.JsonNode>> onSubscribe, boolean streamArray)
      Specified by:
      createReactiveParser in interface io.micronaut.json.JsonMapper
    • cloneWithViewClass

      @NonNull public @NonNull io.micronaut.json.JsonMapper cloneWithViewClass(@NonNull @NonNull Class<?> viewClass)
      Specified by:
      cloneWithViewClass in interface io.micronaut.json.JsonMapper
    • updateValueFromTree

      public void updateValueFromTree(Object value, io.micronaut.json.tree.JsonNode tree) throws IOException
      Specified by:
      updateValueFromTree in interface io.micronaut.json.JsonMapper
      Throws:
      IOException