Package dev.morphia.converters
Class Converters
- java.lang.Object
-
- dev.morphia.converters.Converters
-
- Direct Known Subclasses:
CustomConverters
,DefaultConverters
@Deprecated public abstract class Converters extends java.lang.Object
Deprecated.this mechanism is being replaced in 2.0Defines a bundle of converters
-
-
Constructor Summary
Constructors Constructor Description Converters(Mapper mapper)
Deprecated.Creates a bundle with a particular Mapper.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description TypeConverter
addConverter(TypeConverter tc)
Deprecated.Add a type converter.TypeConverter
addConverter(java.lang.Class<? extends TypeConverter> clazz)
Deprecated.Adds a TypeConverter to this bundle.java.lang.Object
decode(java.lang.Class c, java.lang.Object fromDBObject, MappedField mf)
Deprecated.decode theDBObject
and provide the corresponding java (type-safe) object
NOTE: mf might be nulljava.lang.Object
encode(java.lang.Class c, java.lang.Object o)
Deprecated.encode the type safe java object into the correspondingDBObject
java.lang.Object
encode(java.lang.Object o)
Deprecated.encode the type safe java object into the correspondingDBObject
void
fromDBObject(com.mongodb.DBObject dbObj, MappedField mf, java.lang.Object targetEntity)
Deprecated.Creates an entity and populates its state based on the dbObject given.protected TypeConverter
getEncoder(java.lang.Class c)
Deprecated.protected TypeConverter
getEncoder(java.lang.Object val, MappedField mf)
Deprecated.boolean
hasDbObjectConverter(MappedField field)
Deprecated.boolean
hasDbObjectConverter(java.lang.Class c)
Deprecated.boolean
hasSimpleValueConverter(MappedField c)
Deprecated.boolean
hasSimpleValueConverter(java.lang.Class c)
Deprecated.boolean
hasSimpleValueConverter(java.lang.Object o)
Deprecated.boolean
isRegistered(java.lang.Class<? extends TypeConverter> tcClass)
Deprecated.void
removeConverter(TypeConverter tc)
Deprecated.Removes the type converter.void
toDBObject(java.lang.Object containingObject, MappedField mf, com.mongodb.DBObject dbObj, MapperOptions opts)
Deprecated.Converts an entity to a DBObject
-
-
-
Constructor Detail
-
Converters
public Converters(Mapper mapper)
Deprecated.Creates a bundle with a particular Mapper.- Parameters:
mapper
- the Mapper to use
-
-
Method Detail
-
addConverter
public TypeConverter addConverter(java.lang.Class<? extends TypeConverter> clazz)
Deprecated.Adds a TypeConverter to this bundle.- Parameters:
clazz
- the converter to add- Returns:
- the new instance
-
addConverter
public TypeConverter addConverter(TypeConverter tc)
Deprecated.Add a type converter. If it is a duplicate for an existing type, it will override that type.- Parameters:
tc
- the converter to add- Returns:
- the TypeConverter passed in
-
decode
public java.lang.Object decode(java.lang.Class c, java.lang.Object fromDBObject, MappedField mf)
Deprecated.decode theDBObject
and provide the corresponding java (type-safe) object
NOTE: mf might be null- Parameters:
c
- the class to create and populatefromDBObject
- the DBObject to use when populating the new instancemf
- the MappedField that contains the metadata useful for decoding- Returns:
- the new instance
-
encode
public java.lang.Object encode(java.lang.Object o)
Deprecated.encode the type safe java object into the correspondingDBObject
- Parameters:
o
- The object to encode- Returns:
- the encoded version of the object
-
encode
public java.lang.Object encode(java.lang.Class c, java.lang.Object o)
Deprecated.encode the type safe java object into the correspondingDBObject
- Parameters:
c
- The type to use when encodingo
- The object to encode- Returns:
- the encoded version of the object
-
fromDBObject
public void fromDBObject(com.mongodb.DBObject dbObj, MappedField mf, java.lang.Object targetEntity)
Deprecated.Creates an entity and populates its state based on the dbObject given. This method is primarily an internal method. Reliance on this method may break your application in future releases.- Parameters:
dbObj
- the object state to usemf
- the MappedField containing the metadata to use when decoding in to a fieldtargetEntity
- then entity to hold the state from the database
-
hasDbObjectConverter
public boolean hasDbObjectConverter(MappedField field)
Deprecated.- Parameters:
field
- the field to check with- Returns:
- true if there is a converter for the type of the field
-
hasDbObjectConverter
public boolean hasDbObjectConverter(java.lang.Class c)
Deprecated.- Parameters:
c
- the type to check- Returns:
- true if there is a converter for the type
-
hasSimpleValueConverter
public boolean hasSimpleValueConverter(java.lang.Object o)
Deprecated.- Parameters:
o
- the object/type to check- Returns:
- true if there is a SimpleValueConverter for the type represented by o
- See Also:
SimpleValueConverter
-
hasSimpleValueConverter
public boolean hasSimpleValueConverter(java.lang.Class c)
Deprecated.- Parameters:
c
- the type to check- Returns:
- true if there is a SimpleValueConverter for the type represented by c
- See Also:
SimpleValueConverter
-
hasSimpleValueConverter
public boolean hasSimpleValueConverter(MappedField c)
Deprecated.- Parameters:
c
- the type to check- Returns:
- true if there is a SimpleValueConverter for the type represented by c
- See Also:
SimpleValueConverter
-
isRegistered
public boolean isRegistered(java.lang.Class<? extends TypeConverter> tcClass)
Deprecated.- Parameters:
tcClass
- the type to check- Returns:
- true if a converter of this type has been registered
-
removeConverter
public void removeConverter(TypeConverter tc)
Deprecated.Removes the type converter.- Parameters:
tc
- the converter to remove
-
toDBObject
public void toDBObject(java.lang.Object containingObject, MappedField mf, com.mongodb.DBObject dbObj, MapperOptions opts)
Deprecated.Converts an entity to a DBObject- Parameters:
containingObject
- The object to convertmf
- the MappedField to extractdbObj
- the DBObject to populateopts
- the options to apply
-
getEncoder
protected TypeConverter getEncoder(java.lang.Class c)
Deprecated.
-
getEncoder
protected TypeConverter getEncoder(java.lang.Object val, MappedField mf)
Deprecated.
-
-