Package org.bson.codecs.pojo
Interface PropertyCodecProvider
-
public interface PropertyCodecProvider
A variant ofCodecProvider
that generates codecs forPojoCodec
.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 throughPojoCodecProvider.builder()
.- Since:
- 3.6
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <T> Codec<T>
get(TypeWithTypeParameters<T> type, PropertyCodecRegistry registry)
Get aCodec
using the given context, which includes, most importantly, the class and bound type parameters for which aCodec
is required.
-
-
-
Method Detail
-
get
<T> Codec<T> get(TypeWithTypeParameters<T> type, PropertyCodecRegistry registry)
Get aCodec
using the given context, which includes, most importantly, the class and bound type parameters for which aCodec
is 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
-
-