public class DocumentCodecProvider extends Object implements CodecProvider
CodecProvider
for the Document class and all the default Codec implementations on which it depends.Constructor and Description |
---|
DocumentCodecProvider()
Construct a new instance with a default
BsonTypeClassMap . |
DocumentCodecProvider(BsonTypeClassMap bsonTypeClassMap)
Construct a new instance with the given instance of
BsonTypeClassMap . |
DocumentCodecProvider(BsonTypeClassMap bsonTypeClassMap,
Transformer valueTransformer)
Construct a new instance with the given instance of
BsonTypeClassMap . |
DocumentCodecProvider(Transformer valueTransformer)
Construct a new instance with a default
BsonTypeClassMap and the given Transformer . |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
<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. |
int |
hashCode() |
public DocumentCodecProvider()
BsonTypeClassMap
.public DocumentCodecProvider(Transformer valueTransformer)
BsonTypeClassMap
and the given Transformer
. The transformer is used by the
DocumentCodec as a last step when decoding values.valueTransformer
- the value transformer for decoded valuesDocumentCodec.DocumentCodec(org.bson.codecs.configuration.CodecRegistry, BsonTypeClassMap, org.bson.Transformer)
public DocumentCodecProvider(BsonTypeClassMap bsonTypeClassMap)
BsonTypeClassMap
.bsonTypeClassMap
- the non-null BsonTypeClassMap
with which to construct instances of DocumentCodec
and ListCodec
public DocumentCodecProvider(BsonTypeClassMap bsonTypeClassMap, Transformer valueTransformer)
BsonTypeClassMap
.bsonTypeClassMap
- the non-null BsonTypeClassMap
with which to construct instances of DocumentCodec
and ListCodec
.valueTransformer
- the value transformer for decoded valuespublic <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