Package org.bson.codecs
Class BsonValueCodecProvider
java.lang.Object
org.bson.codecs.BsonValueCodecProvider
- All Implemented Interfaces:
CodecProvider
A
CodecProvider
for all subclass of BsonValue.- Since:
- 3.0
-
Constructor Summary
ConstructorDescriptionConstruct a new instance with the default codec for each BSON type. -
Method Summary
Modifier and TypeMethodDescription<T> Codec<T>
get
(Class<T> clazz, CodecRegistry registry) Get aCodec
using the given context, which includes, most importantly, the Class for which aCodec
is required.static BsonTypeClassMap
Gets the BsonTypeClassMap used by this provider.getClassForBsonType
(BsonType bsonType) Get theBsonValue
subclass associated with the givenBsonType
.
-
Constructor Details
-
BsonValueCodecProvider
public BsonValueCodecProvider()Construct a new instance with the default codec for each BSON type.
-
-
Method Details
-
getClassForBsonType
Get theBsonValue
subclass associated with the givenBsonType
.- Parameters:
bsonType
- the BsonType- Returns:
- the class associated with the given type
-
getBsonTypeClassMap
Gets the BsonTypeClassMap used by this provider.- Returns:
- the non-null BsonTypeClassMap
- Since:
- 3.3
-
get
Description copied from interface:CodecProvider
Get aCodec
using the given context, which includes, most importantly, the Class for which aCodec
is required.- Specified by:
get
in interfaceCodecProvider
- Type Parameters:
T
- the type of the class for which a Codec is required- Parameters:
clazz
- the Class for which to get a Codecregistry
- the registry to use for resolving dependent Codec instances- Returns:
- the Codec instance, which may be null, if this source is unable to provide one for the requested Class
-