Package de.bild.codec
Class PojoContext
java.lang.Object
de.bild.codec.PojoContext
-
Method Summary
Modifier and TypeMethodDescription<T> org.bson.codecs.Codec<T><T> org.bson.codecs.Codec<T>getCodec(Type type, TypeCodecRegistry typeCodecRegistry) Calculates and returns a codec for the given type, null otherwise<T> PolymorphicCodec<T>resolve(Type type, TypeCodecRegistry typeCodecRegistry) Iterates over the list of codecResolvers and returns a PolymorphicCodec if match is found.
-
Method Details
-
get
public <T> org.bson.codecs.Codec<T> get(Class<T> clazz, org.bson.codecs.configuration.CodecRegistry registry) -
getCodec
Calculates and returns a codec for the given type, null otherwise- Type Parameters:
T- the value type- Parameters:
type- type for which a codec is requestedtypeCodecRegistry- codec registry that can handle any type including parameterizd types, generic arrays, etc- Returns:
- the codec responsible for the given type or null
-
resolve
Iterates over the list of codecResolvers and returns a PolymorphicCodec if match is found. Codecs eligible to encode/decode sub classes of polymorphic structures need to provide special functionality and can be registered during setup of the PojoCodecProviderPojoCodecProvider.Builder.registerCodecResolver(CodecResolver[])- Parameters:
type- the value typetypeCodecRegistry- codec registry that can handle any type including parameterizd types, generic arrays, etc- Returns:
- PolymorphicCodec if responsible resolver is found
-