Package org.bson.codecs.pojo
Interface PropertyCodecProvider
public interface PropertyCodecProvider
A variant of
CodecProvider that generates codecs for PojoCodec.
This is a specialized codec provider that retrieves codecs which account for type parameters associated with
a property. In particular this should only be used to add support for custom container types like optionals.
It's only applicable for use by PojoCodec registered through PojoCodecProvider.builder().
- Since:
- 3.6
-
Method Summary
Modifier and TypeMethodDescription<T> Codec<T>get(TypeWithTypeParameters<T> type, PropertyCodecRegistry registry) Get aCodecusing the given context, which includes, most importantly, the class and bound type parameters for which aCodecis required.
-
Method Details
-
get
Get aCodecusing the given context, which includes, most importantly, the class and bound type parameters for which aCodecis required.- Type Parameters:
T- the type of the class for which a Codec is required- Parameters:
type- the class and bound type parameters 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
-