Class AbstractBsonMapper

java.lang.Object
io.micronaut.serde.bson.AbstractBsonMapper
All Implemented Interfaces:
io.micronaut.json.JsonMapper, io.micronaut.serde.ObjectMapper
Direct Known Subclasses:
BsonBinaryMapper, BsonJsonMapper

@Internal public abstract class AbstractBsonMapper extends Object implements io.micronaut.serde.ObjectMapper
Abstract Bson mapper.
  • Nested Class Summary

    Nested classes/interfaces inherited from interface io.micronaut.serde.ObjectMapper

    io.micronaut.serde.ObjectMapper.CloseableObjectMapper
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected io.micronaut.serde.Deserializer.DecoderContext
     
    protected io.micronaut.serde.Serializer.EncoderContext
     
    protected final io.micronaut.serde.SerdeRegistry
     
    protected final @Nullable io.micronaut.serde.config.SerdeConfiguration
     
    protected final Class<?>
     
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
     
    AbstractBsonMapper(io.micronaut.serde.SerdeRegistry registry, io.micronaut.serde.config.SerdeConfiguration serdeConfiguration)
     
    protected
    AbstractBsonMapper(io.micronaut.serde.SerdeRegistry registry, io.micronaut.serde.config.SerdeConfiguration serdeConfiguration, Class<?> view)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected abstract org.bson.BsonReader
     
    protected abstract org.bson.AbstractBsonWriter
     
    org.reactivestreams.Processor<byte[],io.micronaut.json.tree.JsonNode>
    createReactiveParser(Consumer<org.reactivestreams.Processor<byte[],io.micronaut.json.tree.JsonNode>> onSubscribe, boolean streamArray)
     
    io.micronaut.json.JsonStreamConfig
     
    <T> T
    readValue(byte[] byteArray, io.micronaut.core.type.Argument<T> type)
     
    <T> T
    readValue(InputStream inputStream, io.micronaut.core.type.Argument<T> type)
     
    <T> T
    readValueFromTree(io.micronaut.json.tree.JsonNode tree, io.micronaut.core.type.Argument<T> type)
     
    <T> void
    writeValue(OutputStream outputStream, io.micronaut.core.type.Argument<T> type, T object)
     
    void
    writeValue(OutputStream outputStream, Object object)
     
    <T> byte[]
    writeValueAsBytes(io.micronaut.core.type.Argument<T> type, T object)
     
    byte[]
     
    <T> io.micronaut.json.tree.JsonNode
    writeValueToTree(io.micronaut.core.type.Argument<T> type, T value)
     
    io.micronaut.json.tree.JsonNode
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface io.micronaut.json.JsonMapper

    cloneWithViewClass, createSpecific, detectFeatures, readValue, readValue, readValue, readValue, readValue, readValueFromTree, updateValueFromTree, writeValueAsString, writeValueAsString

    Methods inherited from interface io.micronaut.serde.ObjectMapper

    cloneWithConfiguration, cloneWithFeatures, writeValueAsString
  • Field Details

    • registry

      protected final io.micronaut.serde.SerdeRegistry registry
    • serdeConfiguration

      @Nullable protected final @Nullable io.micronaut.serde.config.SerdeConfiguration serdeConfiguration
    • view

      protected final Class<?> view
    • encoderContext

      protected io.micronaut.serde.Serializer.EncoderContext encoderContext
    • decoderContext

      protected io.micronaut.serde.Deserializer.DecoderContext decoderContext
  • Constructor Details

    • AbstractBsonMapper

      public AbstractBsonMapper(io.micronaut.serde.SerdeRegistry registry, io.micronaut.serde.config.SerdeConfiguration serdeConfiguration)
    • AbstractBsonMapper

      protected AbstractBsonMapper(io.micronaut.serde.SerdeRegistry registry, io.micronaut.serde.config.SerdeConfiguration serdeConfiguration, Class<?> view)
  • Method Details

    • createBsonReader

      protected abstract org.bson.BsonReader createBsonReader(ByteBuffer byteBuffer)
    • createBsonWriter

      protected abstract org.bson.AbstractBsonWriter createBsonWriter(OutputStream bsonOutput) throws IOException
      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
    • 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 <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
    • readValueFromTree

      public <T> T readValueFromTree(io.micronaut.json.tree.JsonNode tree, io.micronaut.core.type.Argument<T> type) throws IOException
      Specified by:
      readValueFromTree in interface io.micronaut.json.JsonMapper
      Throws:
      IOException
    • readValue

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

      public 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
    • writeValueToTree

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

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

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

      public io.micronaut.json.JsonStreamConfig getStreamConfig()
      Specified by:
      getStreamConfig in interface io.micronaut.json.JsonMapper