Package org.bson.codecs
Class BsonValueCodec
- java.lang.Object
 - 
- org.bson.codecs.BsonValueCodec
 
 
- 
- 
Constructor Summary
Constructors Constructor Description BsonValueCodec()Creates a new instance with a default codec registry that uses theBsonValueCodecProvider.BsonValueCodec(CodecRegistry codecRegistry)Creates a new instance initialised with the given codec registry. 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BsonValuedecode(BsonReader reader, DecoderContext decoderContext)Decodes a BSON value from the given reader into an instance of the type parameterT.voidencode(BsonWriter writer, BsonValue value, EncoderContext encoderContext)Encode an instance of the type parameterTinto a BSON value.java.lang.Class<BsonValue>getEncoderClass()Returns the Class instance that this encodes. 
 - 
 
- 
- 
Constructor Detail
- 
BsonValueCodec
public BsonValueCodec()
Creates a new instance with a default codec registry that uses theBsonValueCodecProvider. 
- 
BsonValueCodec
public BsonValueCodec(CodecRegistry codecRegistry)
Creates a new instance initialised with the given codec registry.- Parameters:
 codecRegistry- theCodecRegistryto use to look up the codecs for encoding and decoding to/from BSON
 
 - 
 
- 
Method Detail
- 
decode
public BsonValue decode(BsonReader reader, DecoderContext decoderContext)
Description copied from interface:DecoderDecodes a BSON value from the given reader into an instance of the type parameterT. 
- 
encode
public void encode(BsonWriter writer, BsonValue value, EncoderContext encoderContext)
Description copied from interface:EncoderEncode an instance of the type parameterTinto a BSON value. 
- 
getEncoderClass
public java.lang.Class<BsonValue> getEncoderClass()
Description copied from interface:EncoderReturns the Class instance that this encodes. This is necessary because Java does not reify generic types.- Specified by:
 getEncoderClassin interfaceEncoder<BsonValue>- Returns:
 - the Class instance that this encodes.
 
 
 - 
 
 -