public class BsonValueCodecProvider extends java.lang.Object implements CodecProvider
CodecProvider for all subclass of BsonValue.| Modifier and Type | Field and Description |
|---|---|
private java.util.Map<java.lang.Class<?>,Codec<?>> |
codecs |
private static BsonTypeClassMap |
DEFAULT_BSON_TYPE_CLASS_MAP |
| Constructor and Description |
|---|
BsonValueCodecProvider()
Construct a new instance with the default codec for each BSON type.
|
| Modifier and Type | Method and Description |
|---|---|
private <T extends BsonValue> |
addCodec(Codec<T> codec) |
private void |
addCodecs() |
<T> Codec<T> |
get(java.lang.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 java.lang.Class<? extends BsonValue> |
getClassForBsonType(BsonType bsonType)
Get the
BsonValue subclass associated with the given BsonType. |
private static final BsonTypeClassMap DEFAULT_BSON_TYPE_CLASS_MAP
private final java.util.Map<java.lang.Class<?>,Codec<?>> codecs
public BsonValueCodecProvider()
public static java.lang.Class<? extends BsonValue> getClassForBsonType(BsonType bsonType)
BsonValue subclass associated with the given BsonType.bsonType - the BsonTypepublic static BsonTypeClassMap getBsonTypeClassMap()
public <T> Codec<T> get(java.lang.Class<T> clazz, CodecRegistry registry)
CodecProviderCodec using the given context, which includes, most importantly, the Class for which a Codec is required.get in interface CodecProviderT - 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 instancesprivate void addCodecs()