CodecProvider
public class BsonValueCodecProvider extends Object implements CodecProvider
CodecProvider
for all subclass of BsonValue.Constructor | Description |
---|---|
BsonValueCodecProvider() |
Construct a new instance with the default codec for each BSON type.
|
Modifier and Type | Method | Description |
---|---|---|
<T> Codec<T> |
get(Class<T> clazz,
CodecRegistry registry) |
Get a
Codec using the given context, which includes, most importantly, the Class for which a Codec is required. |
static BsonTypeClassMap |
getBsonTypeClassMap() |
Gets the BsonTypeClassMap used by this provider.
|
static Class<? extends BsonValue> |
getClassForBsonType(BsonType bsonType) |
Get the
BsonValue subclass associated with the given BsonType . |
public BsonValueCodecProvider()
public static Class<? extends BsonValue> getClassForBsonType(BsonType bsonType)
BsonValue
subclass associated with the given BsonType
.bsonType
- the BsonTypepublic static BsonTypeClassMap getBsonTypeClassMap()
public <T> Codec<T> get(Class<T> clazz, CodecRegistry registry)
CodecProvider
Codec
using the given context, which includes, most importantly, the Class for which a Codec
is required.get
in interface CodecProvider
T
- the type of the class for which a Codec is requiredclazz
- the Class for which to get a Codecregistry
- the registry to use for resolving dependent Codec instances