Class AbstractBsonMapper

  • All Implemented Interfaces:
    io.micronaut.json.JsonMapper, io.micronaut.serde.ObjectMapper
    Direct Known Subclasses:
    BsonBinaryMapper, BsonJsonMapper

    @Internal
    public abstract class AbstractBsonMapper
    extends java.lang.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 decoderContext  
      protected io.micronaut.serde.Serializer.EncoderContext encoderContext  
      protected io.micronaut.serde.SerdeRegistry registry  
      protected java.lang.Class<?> view  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
        AbstractBsonMapper​(io.micronaut.serde.SerdeRegistry registry)  
      protected AbstractBsonMapper​(io.micronaut.serde.SerdeRegistry registry, java.lang.Class<?> view)  
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      protected abstract org.bson.BsonReader createBsonReader​(java.nio.ByteBuffer byteBuffer)  
      protected abstract org.bson.AbstractBsonWriter createBsonWriter​(java.io.OutputStream bsonOutput)  
      org.reactivestreams.Processor<byte[],​io.micronaut.json.tree.JsonNode> createReactiveParser​(java.util.function.Consumer<org.reactivestreams.Processor<byte[],​io.micronaut.json.tree.JsonNode>> onSubscribe, boolean streamArray)  
      io.micronaut.json.JsonStreamConfig getStreamConfig()  
      <T> T readValue​(byte[] byteArray, io.micronaut.core.type.Argument<T> type)  
      <T> T readValue​(java.io.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​(java.io.OutputStream outputStream, io.micronaut.core.type.Argument<T> type, T object)  
      void writeValue​(java.io.OutputStream outputStream, java.lang.Object object)  
      <T> byte[] writeValueAsBytes​(io.micronaut.core.type.Argument<T> type, T object)  
      byte[] writeValueAsBytes​(java.lang.Object object)  
      <T> io.micronaut.json.tree.JsonNode writeValueToTree​(io.micronaut.core.type.Argument<T> type, T value)  
      io.micronaut.json.tree.JsonNode writeValueToTree​(java.lang.Object value)  
      • 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, detectFeatures, readValue, readValueFromTree, updateValueFromTree
      • Methods inherited from interface io.micronaut.serde.ObjectMapper

        cloneWithFeatures, readValue, readValue, readValue, writeValueAsString, writeValueAsString, writeValueAsString
    • Field Detail

      • registry

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

        protected final java.lang.Class<?> view
      • encoderContext

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

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

      • AbstractBsonMapper

        public AbstractBsonMapper​(io.micronaut.serde.SerdeRegistry registry)
      • AbstractBsonMapper

        protected AbstractBsonMapper​(io.micronaut.serde.SerdeRegistry registry,
                                     java.lang.Class<?> view)
    • Method Detail

      • createBsonReader

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

        protected abstract org.bson.AbstractBsonWriter createBsonWriter​(java.io.OutputStream bsonOutput)
                                                                 throws java.io.IOException
        Throws:
        java.io.IOException
      • writeValueToTree

        public <T> io.micronaut.json.tree.JsonNode writeValueToTree​(io.micronaut.core.type.Argument<T> type,
                                                                    T value)
                                                             throws java.io.IOException
        Specified by:
        writeValueToTree in interface io.micronaut.json.JsonMapper
        Throws:
        java.io.IOException
      • writeValue

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

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

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

        public <T> T readValue​(java.io.InputStream inputStream,
                               io.micronaut.core.type.Argument<T> type)
                        throws java.io.IOException
        Specified by:
        readValue in interface io.micronaut.json.JsonMapper
        Throws:
        java.io.IOException
      • readValue

        public <T> T readValue​(byte[] byteArray,
                               io.micronaut.core.type.Argument<T> type)
                        throws java.io.IOException
        Specified by:
        readValue in interface io.micronaut.json.JsonMapper
        Throws:
        java.io.IOException
      • createReactiveParser

        public org.reactivestreams.Processor<byte[],​io.micronaut.json.tree.JsonNode> createReactiveParser​(java.util.function.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​(java.lang.Object value)
                                                         throws java.io.IOException
        Specified by:
        writeValueToTree in interface io.micronaut.json.JsonMapper
        Throws:
        java.io.IOException
      • writeValue

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

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

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