Package dev.morphia.mapping.codec
Class MorphiaCodecProvider
- java.lang.Object
-
- dev.morphia.mapping.codec.MorphiaCodecProvider
-
- All Implemented Interfaces:
org.bson.codecs.configuration.CodecProvider
public class MorphiaCodecProvider extends Object implements org.bson.codecs.configuration.CodecProvider
Provider for codecs for Morphia entitiesDeveloper note.This is an internal item. Its function and presence are subject to change without warning. Its use is highly discouraged.
-
-
Constructor Summary
Constructors Constructor Description MorphiaCodecProvider(Mapper mapper, Datastore datastore)
Creates a provider
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> org.bson.codecs.Codec<T>
get(Class<T> type, org.bson.codecs.configuration.CodecRegistry registry)
<T> org.bson.codecs.Codec<T>
getRefreshCodec(T entity, org.bson.codecs.configuration.CodecRegistry registry)
Creates a codec that uses an existing entity for loading rather than creating a new instance.
-
-
-
Method Detail
-
get
public <T> org.bson.codecs.Codec<T> get(Class<T> type, org.bson.codecs.configuration.CodecRegistry registry)
- Specified by:
get
in interfaceorg.bson.codecs.configuration.CodecProvider
-
getRefreshCodec
public <T> org.bson.codecs.Codec<T> getRefreshCodec(T entity, org.bson.codecs.configuration.CodecRegistry registry)
Creates a codec that uses an existing entity for loading rather than creating a new instance.- Type Parameters:
T
- the entity type- Parameters:
entity
- the entity to refreshregistry
- the codec registry- Returns:
- the new codec
-
-