Class BsonReaderDecoder

java.lang.Object
io.micronaut.serde.LimitingStream
io.micronaut.serde.support.AbstractStreamDecoder
io.micronaut.serde.support.AbstractDecoderPerStructureStreamDecoder
io.micronaut.serde.bson.BsonReaderDecoder
All Implemented Interfaces:
io.micronaut.serde.Decoder, AutoCloseable

@Internal public final class BsonReaderDecoder extends io.micronaut.serde.support.AbstractDecoderPerStructureStreamDecoder
Bson implementation of Decoder.
  • Nested Class Summary

    Nested classes/interfaces inherited from class io.micronaut.serde.support.AbstractStreamDecoder

    io.micronaut.serde.support.AbstractStreamDecoder.TokenType, io.micronaut.serde.support.AbstractStreamDecoder.ValueDecoder<R extends Object>

    Nested classes/interfaces inherited from class io.micronaut.serde.LimitingStream

    io.micronaut.serde.LimitingStream.RemainingLimits
  • Field Summary

    Fields inherited from class io.micronaut.serde.LimitingStream

    DEFAULT_LIMITS, DEFAULT_MAXIMUM_DEPTH
  • Constructor Summary

    Constructors
    Constructor
    Description
    BsonReaderDecoder(org.bson.BsonReader bsonReader, @NonNull io.micronaut.serde.LimitingStream.RemainingLimits remainingLimits)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    backFromChild(io.micronaut.serde.support.AbstractStreamDecoder child)
     
    protected String
    coerceScalarToString(io.micronaut.serde.support.AbstractStreamDecoder.TokenType currentToken)
     
    protected io.micronaut.serde.support.AbstractStreamDecoder
     
     
    protected io.micronaut.serde.support.AbstractStreamDecoder.TokenType
     
    byte @NonNull []
     
    io.micronaut.serde.Decoder
     
    <T> T
    decodeCustom(org.bson.codecs.Decoder<T> decoder, org.bson.codecs.DecoderContext context)
     
    org.bson.types.Decimal128
    Decodes Decimal128.
    org.bson.types.ObjectId
    Decodes ObjectId.
    protected Number
     
    protected BigDecimal
     
    protected BigInteger
     
    protected boolean
     
    protected String
     
    protected double
     
    protected long
     
    protected String
     
    protected void
     
    protected void
     

    Methods inherited from class io.micronaut.serde.support.AbstractDecoderPerStructureStreamDecoder

    decodeArray0, decodeKey, decodeObject0, finishStructure, hasNextArrayValue, preDecodeValue

    Methods inherited from class io.micronaut.serde.support.AbstractStreamDecoder

    consumeLeftElements, decodeArbitrary, decodeArray, decodeBigDecimal, decodeBigInteger, decodeBoolean, decodeByte, decodeChar, decodeCustom, decodeCustom, decodeDouble, decodeFloat, decodeInt, decodeLong, decodeNode, decodeNull, decodeNumber, decodeObject, decodeShort, decodeString, getBestNumberNode, getInteger, skipValue, unexpectedToken

    Methods inherited from class io.micronaut.serde.LimitingStream

    childLimits, decreaseDepth, increaseDepth, limitsFromConfiguration, ourLimits

    Methods inherited from class java.lang.Object

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

    Methods inherited from interface io.micronaut.serde.Decoder

    close, decodeArray, decodeBigDecimalNullable, decodeBigIntegerNullable, decodeBinaryNullable, decodeBooleanNullable, decodeByteNullable, decodeCharNullable, decodeDoubleNullable, decodeFloatNullable, decodeIntNullable, decodeLongNullable, decodeObject, decodeShortNullable, decodeStringNullable, finishStructure
  • Constructor Details

    • BsonReaderDecoder

      public BsonReaderDecoder(org.bson.BsonReader bsonReader, @NonNull @NonNull io.micronaut.serde.LimitingStream.RemainingLimits remainingLimits)
  • Method Details

    • backFromChild

      protected void backFromChild(io.micronaut.serde.support.AbstractStreamDecoder child) throws IOException
      Overrides:
      backFromChild in class io.micronaut.serde.support.AbstractDecoderPerStructureStreamDecoder
      Throws:
      IOException
    • nextToken

      protected void nextToken()
      Specified by:
      nextToken in class io.micronaut.serde.support.AbstractStreamDecoder
    • getCurrentKey

      protected String getCurrentKey()
      Specified by:
      getCurrentKey in class io.micronaut.serde.support.AbstractStreamDecoder
    • coerceScalarToString

      protected String coerceScalarToString(io.micronaut.serde.support.AbstractStreamDecoder.TokenType currentToken) throws IOException
      Specified by:
      coerceScalarToString in class io.micronaut.serde.support.AbstractStreamDecoder
      Throws:
      IOException
    • createChildDecoder

      protected io.micronaut.serde.support.AbstractStreamDecoder createChildDecoder() throws io.micronaut.serde.exceptions.SerdeException
      Specified by:
      createChildDecoder in class io.micronaut.serde.support.AbstractDecoderPerStructureStreamDecoder
      Throws:
      io.micronaut.serde.exceptions.SerdeException
    • getString

      protected String getString()
      Specified by:
      getString in class io.micronaut.serde.support.AbstractStreamDecoder
    • getBoolean

      protected boolean getBoolean()
      Specified by:
      getBoolean in class io.micronaut.serde.support.AbstractStreamDecoder
    • getLong

      protected long getLong()
      Specified by:
      getLong in class io.micronaut.serde.support.AbstractStreamDecoder
    • getDouble

      protected double getDouble()
      Specified by:
      getDouble in class io.micronaut.serde.support.AbstractStreamDecoder
    • getBigInteger

      protected BigInteger getBigInteger()
      Specified by:
      getBigInteger in class io.micronaut.serde.support.AbstractStreamDecoder
    • getBigDecimal

      protected BigDecimal getBigDecimal()
      Specified by:
      getBigDecimal in class io.micronaut.serde.support.AbstractStreamDecoder
    • getBestNumber

      protected Number getBestNumber()
      Specified by:
      getBestNumber in class io.micronaut.serde.support.AbstractStreamDecoder
    • decodeBinary

      public byte @NonNull [] decodeBinary() throws IOException
      Specified by:
      decodeBinary in interface io.micronaut.serde.Decoder
      Overrides:
      decodeBinary in class io.micronaut.serde.support.AbstractStreamDecoder
      Throws:
      IOException
    • skipChildren

      protected void skipChildren()
      Specified by:
      skipChildren in class io.micronaut.serde.support.AbstractStreamDecoder
    • currentToken

      protected io.micronaut.serde.support.AbstractStreamDecoder.TokenType currentToken()
      Specified by:
      currentToken in class io.micronaut.serde.support.AbstractStreamDecoder
    • createDeserializationException

      public IOException createDeserializationException(String message, Object invalidValue)
    • decodeDecimal128

      public org.bson.types.Decimal128 decodeDecimal128() throws IOException
      Decodes Decimal128.
      Returns:
      decoded value
      Throws:
      IOException
    • decodeObjectId

      public org.bson.types.ObjectId decodeObjectId() throws IOException
      Decodes ObjectId.
      Returns:
      decoded value
      Throws:
      IOException
    • decodeCustom

      public <T> T decodeCustom(org.bson.codecs.Decoder<T> decoder, org.bson.codecs.DecoderContext context) throws IOException
      Throws:
      IOException
    • decodeBuffer

      public io.micronaut.serde.Decoder decodeBuffer() throws IOException
      Specified by:
      decodeBuffer in interface io.micronaut.serde.Decoder
      Overrides:
      decodeBuffer in class io.micronaut.serde.support.AbstractStreamDecoder
      Throws:
      IOException