Package org.bson.codecs
Class BsonDocumentWrapperCodec
java.lang.Object
org.bson.codecs.BsonDocumentWrapperCodec
- All Implemented Interfaces:
Codec<BsonDocumentWrapper>
,Decoder<BsonDocumentWrapper>
,Encoder<BsonDocumentWrapper>
A Codec
- Since:
- 3.0
-
Constructor Summary
ConstructorDescriptionBsonDocumentWrapperCodec
(Codec<BsonDocument> bsonDocumentCodec) Construct a new instance, -
Method Summary
Modifier and TypeMethodDescriptiondecode
(BsonReader reader, DecoderContext decoderContext) Decoding ofBsonDocumentWrapper
instances is not supported, so this method will throwUnsupportedOperationException
in all cases.void
encode
(BsonWriter writer, BsonDocumentWrapper value, EncoderContext encoderContext) Encode an instance of the type parameterT
into a BSON value.Returns the Class instance that this encodes.
-
Constructor Details
-
BsonDocumentWrapperCodec
Construct a new instance,- Parameters:
bsonDocumentCodec
- the code to use if theBsonDocumentWrapper
has been unwrapped.
-
-
Method Details
-
decode
Decoding ofBsonDocumentWrapper
instances is not supported, so this method will throwUnsupportedOperationException
in all cases.- Specified by:
decode
in interfaceDecoder<BsonDocumentWrapper>
- Parameters:
reader
- the BSON reader the readerdecoderContext
- a decoder context, currently unused- Returns:
- the document
-
encode
Description copied from interface:Encoder
Encode an instance of the type parameterT
into a BSON value.- Specified by:
encode
in interfaceEncoder<BsonDocumentWrapper>
- Parameters:
writer
- the BSON writer to encode intovalue
- the value to encodeencoderContext
- the encoder context
-
getEncoderClass
Description copied from interface:Encoder
Returns the Class instance that this encodes. This is necessary because Java does not reify generic types.- Specified by:
getEncoderClass
in interfaceEncoder<BsonDocumentWrapper>
- Returns:
- the Class instance that this encodes.
-