Package org.bson.codecs
Class BsonValueCodecProvider
- java.lang.Object
-
- org.bson.codecs.BsonValueCodecProvider
-
- All Implemented Interfaces:
CodecProvider
public class BsonValueCodecProvider extends java.lang.Object implements CodecProvider
ACodecProvider
for all subclass of BsonValue.- Since:
- 3.0
-
-
Constructor Summary
Constructors Constructor Description BsonValueCodecProvider()
Construct a new instance with the default codec for each BSON type.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> Codec<T>
get(java.lang.Class<T> clazz, CodecRegistry registry)
Get aCodec
using the given context, which includes, most importantly, the Class for which aCodec
is required.static BsonTypeClassMap
getBsonTypeClassMap()
Gets the BsonTypeClassMap used by this provider.static java.lang.Class<? extends BsonValue>
getClassForBsonType(BsonType bsonType)
Get theBsonValue
subclass associated with the givenBsonType
.
-
-
-
Method Detail
-
getClassForBsonType
public static java.lang.Class<? extends BsonValue> getClassForBsonType(BsonType bsonType)
Get theBsonValue
subclass associated with the givenBsonType
.- Parameters:
bsonType
- the BsonType- Returns:
- the class associated with the given type
-
getBsonTypeClassMap
public static BsonTypeClassMap getBsonTypeClassMap()
Gets the BsonTypeClassMap used by this provider.- Returns:
- the non-null BsonTypeClassMap
- Since:
- 3.3
-
get
public <T> Codec<T> get(java.lang.Class<T> clazz, CodecRegistry registry)
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
-
-