Package io.micronaut.serde.bson
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
ConstructorsConstructorDescriptionBsonReaderDecoder(org.bson.BsonReader bsonReader, @NonNull io.micronaut.serde.LimitingStream.RemainingLimits remainingLimits) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidbackFromChild(io.micronaut.serde.support.AbstractStreamDecoder child) protected StringcoerceScalarToString(io.micronaut.serde.support.AbstractStreamDecoder.TokenType currentToken) protected io.micronaut.serde.support.AbstractStreamDecodercreateDeserializationException(String message, Object invalidValue) protected io.micronaut.serde.support.AbstractStreamDecoder.TokenTypebyte @NonNull []io.micronaut.serde.Decoder<T> TdecodeCustom(org.bson.codecs.Decoder<T> decoder, org.bson.codecs.DecoderContext context) org.bson.types.Decimal128DecodesDecimal128.org.bson.types.ObjectIdDecodesObjectId.protected Numberprotected BigDecimalprotected BigIntegerprotected booleanprotected Stringprotected doubleprotected longgetLong()protected Stringprotected voidprotected voidMethods inherited from class io.micronaut.serde.support.AbstractDecoderPerStructureStreamDecoder
decodeArray0, decodeKey, decodeObject0, finishStructure, hasNextArrayValue, preDecodeValueMethods 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, unexpectedTokenMethods inherited from class io.micronaut.serde.LimitingStream
childLimits, decreaseDepth, increaseDepth, limitsFromConfiguration, ourLimitsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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:
backFromChildin classio.micronaut.serde.support.AbstractDecoderPerStructureStreamDecoder- Throws:
IOException
-
nextToken
protected void nextToken()- Specified by:
nextTokenin classio.micronaut.serde.support.AbstractStreamDecoder
-
getCurrentKey
- Specified by:
getCurrentKeyin classio.micronaut.serde.support.AbstractStreamDecoder
-
coerceScalarToString
protected String coerceScalarToString(io.micronaut.serde.support.AbstractStreamDecoder.TokenType currentToken) throws IOException - Specified by:
coerceScalarToStringin classio.micronaut.serde.support.AbstractStreamDecoder- Throws:
IOException
-
createChildDecoder
protected io.micronaut.serde.support.AbstractStreamDecoder createChildDecoder() throws io.micronaut.serde.exceptions.SerdeException- Specified by:
createChildDecoderin classio.micronaut.serde.support.AbstractDecoderPerStructureStreamDecoder- Throws:
io.micronaut.serde.exceptions.SerdeException
-
getString
- Specified by:
getStringin classio.micronaut.serde.support.AbstractStreamDecoder
-
getBoolean
protected boolean getBoolean()- Specified by:
getBooleanin classio.micronaut.serde.support.AbstractStreamDecoder
-
getLong
protected long getLong()- Specified by:
getLongin classio.micronaut.serde.support.AbstractStreamDecoder
-
getDouble
protected double getDouble()- Specified by:
getDoublein classio.micronaut.serde.support.AbstractStreamDecoder
-
getBigInteger
- Specified by:
getBigIntegerin classio.micronaut.serde.support.AbstractStreamDecoder
-
getBigDecimal
- Specified by:
getBigDecimalin classio.micronaut.serde.support.AbstractStreamDecoder
-
getBestNumber
- Specified by:
getBestNumberin classio.micronaut.serde.support.AbstractStreamDecoder
-
decodeBinary
- Specified by:
decodeBinaryin interfaceio.micronaut.serde.Decoder- Overrides:
decodeBinaryin classio.micronaut.serde.support.AbstractStreamDecoder- Throws:
IOException
-
skipChildren
protected void skipChildren()- Specified by:
skipChildrenin classio.micronaut.serde.support.AbstractStreamDecoder
-
currentToken
protected io.micronaut.serde.support.AbstractStreamDecoder.TokenType currentToken()- Specified by:
currentTokenin classio.micronaut.serde.support.AbstractStreamDecoder
-
createDeserializationException
-
decodeDecimal128
DecodesDecimal128.- Returns:
- decoded value
- Throws:
IOException
-
decodeObjectId
DecodesObjectId.- 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
- Specified by:
decodeBufferin interfaceio.micronaut.serde.Decoder- Overrides:
decodeBufferin classio.micronaut.serde.support.AbstractStreamDecoder- Throws:
IOException
-