Class OracleJdbcJsonParserDecoder
java.lang.Object
io.micronaut.serde.LimitingStream
io.micronaut.serde.support.AbstractStreamDecoder
io.micronaut.serde.oracle.jdbc.json.OracleJdbcJsonParserDecoder
- All Implemented Interfaces:
Decoder,AutoCloseable
Implementation of the
Decoder interface for Oracle JDBC JSON.- Since:
- 1.2.0
- Author:
- Denis Stepanov
-
Nested Class Summary
Nested classes/interfaces inherited from class io.micronaut.serde.support.AbstractStreamDecoder
AbstractStreamDecoder.TokenType, AbstractStreamDecoder.ValueDecoder<R>Nested classes/interfaces inherited from class io.micronaut.serde.LimitingStream
LimitingStream.RemainingLimits -
Field Summary
Fields inherited from class io.micronaut.serde.LimitingStream
DEFAULT_LIMITS, DEFAULT_MAXIMUM_DEPTH -
Method Summary
Modifier and TypeMethodDescriptionprotected StringcoerceScalarToString(AbstractStreamDecoder.TokenType currentToken) Decode any non-null scalar value (number, string or boolean) to its string representation.@NonNull IOExceptioncreateDeserializationException(@NonNull String message, @Nullable Object invalidValue) Creates an exception for the given message.protected AbstractStreamDecoder.TokenTypebyte[]Decodes Oracle JSON binary data as byte array.Decodes Oracle JSON value asLocalDateTime.Decodes Oracle JSON value asOffsetDateTime.Decodes Oracle JSON value asZonedDateTime.voidfinishStructure(boolean consumeLeftElements) protected NumberDecode the currentAbstractStreamDecoder.TokenType.NUMBERvalue as aNumbervalue.protected BigDecimalDecode the currentAbstractStreamDecoder.TokenType.NUMBERvalue as aBigDecimalvalue.protected BigIntegerDecode the currentAbstractStreamDecoder.TokenType.NUMBERvalue as aBigIntegervalue.protected booleanDecode the currentAbstractStreamDecoder.TokenType.BOOLEANvalue.protected StringGet the current object field name.protected doubleDecode the currentAbstractStreamDecoder.TokenType.NUMBERvalue as a double value.protected longgetLong()Decode the currentAbstractStreamDecoder.TokenType.NUMBERvalue as a long value.protected StringDecode the currentAbstractStreamDecoder.TokenType.STRINGvalue.protected voidMove to the next token.protected voidIf we are at aAbstractStreamDecoder.TokenType.START_OBJECTorAbstractStreamDecoder.TokenType.START_ARRAY, skip to the matchingAbstractStreamDecoder.TokenType.END_OBJECTorAbstractStreamDecoder.TokenType.END_ARRAY.Methods inherited from class io.micronaut.serde.support.AbstractStreamDecoder
consumeLeftElements, decodeArbitrary, decodeArray, decodeArray0, decodeBigDecimal, decodeBigInteger, decodeBoolean, decodeBuffer, decodeByte, decodeChar, decodeCustom, decodeCustom, decodeDouble, decodeFloat, decodeInt, decodeKey, decodeLong, decodeNode, decodeNull, decodeNumber, decodeObject, decodeObject0, decodeShort, decodeString, getBestNumberNode, getBigDecimalFromNumber, getInteger, hasNextArrayValue, preDecodeValue, 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, decodeNumber, decodeNumberNullable, decodeObject, decodeShortNullable, decodeStringNullable, finishStructure
-
Method Details
-
finishStructure
- Specified by:
finishStructurein interfaceDecoder- Overrides:
finishStructurein classAbstractStreamDecoder- Parameters:
consumeLeftElements- True to consume left elements- Throws:
IOException- If an unrecoverable error occurs
-
currentToken
- Specified by:
currentTokenin classAbstractStreamDecoder- Returns:
- The current token.
-
nextToken
protected void nextToken()Description copied from class:AbstractStreamDecoderMove to the next token.- Specified by:
nextTokenin classAbstractStreamDecoder
-
getCurrentKey
Description copied from class:AbstractStreamDecoderGet the current object field name. Only called forAbstractStreamDecoder.TokenType.KEY.- Specified by:
getCurrentKeyin classAbstractStreamDecoder- Returns:
- The current field key
-
coerceScalarToString
Description copied from class:AbstractStreamDecoderDecode any non-null scalar value (number, string or boolean) to its string representation.- Specified by:
coerceScalarToStringin classAbstractStreamDecoder- Parameters:
currentToken- The current token- Returns:
- The current value, coerced to a string
-
getBoolean
protected boolean getBoolean()Description copied from class:AbstractStreamDecoderDecode the currentAbstractStreamDecoder.TokenType.BOOLEANvalue. Called for no other token type.- Specified by:
getBooleanin classAbstractStreamDecoder- Returns:
- The boolean value
-
getString
Description copied from class:AbstractStreamDecoderDecode the currentAbstractStreamDecoder.TokenType.STRINGvalue. Called for no other token type.- Specified by:
getStringin classAbstractStreamDecoder- Returns:
- The String value
-
getLong
protected long getLong()Description copied from class:AbstractStreamDecoderDecode the currentAbstractStreamDecoder.TokenType.NUMBERvalue as a long value. Called for no other token type.- Specified by:
getLongin classAbstractStreamDecoder- Returns:
- The number value
-
getDouble
protected double getDouble()Description copied from class:AbstractStreamDecoderDecode the currentAbstractStreamDecoder.TokenType.NUMBERvalue as a double value. Called for no other token type.- Specified by:
getDoublein classAbstractStreamDecoder- Returns:
- The number value
-
getBigInteger
Description copied from class:AbstractStreamDecoderDecode the currentAbstractStreamDecoder.TokenType.NUMBERvalue as aBigIntegervalue. Called for no other token type.- Specified by:
getBigIntegerin classAbstractStreamDecoder- Returns:
- The number value
-
getBigDecimal
Description copied from class:AbstractStreamDecoderDecode the currentAbstractStreamDecoder.TokenType.NUMBERvalue as aBigDecimalvalue. Called for no other token type.- Specified by:
getBigDecimalin classAbstractStreamDecoder- Returns:
- The number value
-
getBestNumber
Description copied from class:AbstractStreamDecoderDecode the currentAbstractStreamDecoder.TokenType.NUMBERvalue as aNumbervalue. Called for no other token type.- Specified by:
getBestNumberin classAbstractStreamDecoder- Returns:
- The number value
-
skipChildren
protected void skipChildren()Description copied from class:AbstractStreamDecoderIf we are at aAbstractStreamDecoder.TokenType.START_OBJECTorAbstractStreamDecoder.TokenType.START_ARRAY, skip to the matchingAbstractStreamDecoder.TokenType.END_OBJECTorAbstractStreamDecoder.TokenType.END_ARRAY. Else, do nothing.- Specified by:
skipChildrenin classAbstractStreamDecoder
-
createDeserializationException
@NonNull public @NonNull IOException createDeserializationException(@NonNull @NonNull String message, @Nullable @Nullable Object invalidValue) Description copied from interface:DecoderCreates an exception for the given message.- Parameters:
message- The message, nevernullinvalidValue- The invalid value. Can benull.- Returns:
- The exception, never
null
-
decodeBinary
public byte[] decodeBinary()Decodes Oracle JSON binary data as byte array.- Specified by:
decodeBinaryin interfaceDecoder- Overrides:
decodeBinaryin classAbstractStreamDecoder- Returns:
- the byte array for Oracle JSON binary
-
decodeLocalDateTime
Decodes Oracle JSON value asLocalDateTime.- Returns:
- the
LocalDateTimevalue being decoded
-
decodeOffsetDateTime
Decodes Oracle JSON value asOffsetDateTime.- Returns:
- the
OffsetDateTimevalue being decoded
-
decodeZonedDateTime
Decodes Oracle JSON value asZonedDateTime.- Returns:
- the
ZonedDateTimevalue being decoded
-