Interface KeysAwareDecoder
- All Superinterfaces:
AutoCloseable, Decoder
- All Known Implementing Classes:
BsonReaderDecoder, JacksonDecoder
Optional decoder capability for matching object keys against a known key set.
- Since:
- 3.1
- Author:
- Denis Stepanov
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intMarker for case where the end of an object was encountered.static final intMarker for case where a property name was encountered but not matched by theKeyssupplied todecodeKey(Keys). -
Method Summary
Modifier and TypeMethodDescriptionintDecode the next object key and match it against the supplied key set.static KeysAwareDecoderAdapt the decoder to the keys-aware contract.Methods inherited from interface Decoder
close, createDeserializationException, decodeArbitrary, decodeArray, decodeArray, decodeBigDecimal, decodeBigDecimalNullable, decodeBigInteger, decodeBigIntegerNullable, decodeBinary, decodeBinaryNullable, decodeBoolean, decodeBooleanNullable, decodeBuffer, decodeByte, decodeByteNullable, decodeChar, decodeCharNullable, decodeDouble, decodeDoubleNullable, decodeFloat, decodeFloatNullable, decodeInt, decodeIntNullable, decodeKey, decodeLong, decodeLongNullable, decodeNode, decodeNull, decodeNumber, decodeNumberNullable, decodeObject, decodeObject, decodeShort, decodeShortNullable, decodeString, decodeStringNullable, finishStructure, finishStructure, hasNextArrayValue, skipValue
-
Field Details
-
MATCH_END_OBJECT
static final int MATCH_END_OBJECTMarker for case where the end of an object was encountered.- See Also:
-
MATCH_UNKNOWN_NAME
static final int MATCH_UNKNOWN_NAMEMarker for case where a property name was encountered but not matched by theKeyssupplied todecodeKey(Keys). After this marker is returned, callers should obtain the unmatched property name withDecoder.decodeKey()and handle it as unknown for that same key set. Implementations must not return this marker for a property that matches the supplied keys.- See Also:
-
-
Method Details
-
of
Adapt the decoder to the keys-aware contract.- Parameters:
decoder- The decoder- Returns:
- A keys-aware decoder
-
decodeKey
Decode the next object key and match it against the supplied key set. A non-negative result is the matched key index.MATCH_UNKNOWN_NAMEmeans the current key is available throughDecoder.decodeKey()and is guaranteed not to match the suppliedKeys.- Parameters:
keys- The keys- Returns:
- The matched key index,
MATCH_END_OBJECT, orMATCH_UNKNOWN_NAME - Throws:
IOException- If an unrecoverable error occurs
-