|
Spring Data Document | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.springframework.data.document.mongodb.convert.AbstractMongoConverter
org.springframework.data.document.mongodb.convert.SimpleMongoConverter
MappingMongoConverter
The MappingMongoConverter provides all the functionality of the SimpleMongoConverter and will replace it as the default
converter used. The SimpleMongoCOnverter will be removed at some point before the GA release.
@Deprecated public class SimpleMongoConverter
Basic MongoConverter implementation to convert between domain classes and DBObjects.
| Field Summary |
|---|
| Fields inherited from class org.springframework.data.document.mongodb.convert.AbstractMongoConverter |
|---|
conversionService |
| Constructor Summary | |
|---|---|
SimpleMongoConverter()
Deprecated. Creates a SimpleMongoConverter. |
|
| Method Summary | ||
|---|---|---|
ObjectId |
convertObjectId(Object id)
Deprecated. Returns the ObjectId instance for the given id. |
|
|
convertObjectId(ObjectId id,
Class<T> targetType)
Deprecated. Converts the given ObjectId to the given target type. |
|
protected Map<String,Object> |
createMap()
Deprecated. Create a Map instance. |
|
protected org.springframework.data.document.mongodb.convert.MongoBeanWrapper |
createWrapper(Object target,
boolean fieldAccess)
Deprecated. Callback to allow customizing creation of a MongoBeanWrapper. |
|
List<Class<?>> |
getGenericParameters(Type genericParameterType)
Deprecated. |
|
org.springframework.data.mapping.model.MappingContext<? extends MongoPersistentEntity<?>,MongoPersistentProperty> |
getMappingContext()
Deprecated. |
|
protected static boolean |
isSimpleType(Class<?> propertyType)
Deprecated. |
|
|
read(Class<S> clazz,
DBObject source)
Deprecated. Ready from the native MongoDB DBObject representation to an instance of the class T. |
|
protected Map<?,?> |
readMap(MongoPropertyDescriptors.MongoPropertyDescriptor pd,
DBObject dbo,
Class<?> targetType)
Deprecated. Reads every key/value pair from the DBObject into a Map instance. |
|
void |
write(Object obj,
DBObject dbo)
Deprecated. Write the given object of type T to the native MongoDB object representation DBObject. |
|
protected void |
writeArray(DBObject dbo,
String keyToUse,
Object[] array)
Deprecated. Writes the given array to the given DBObject. |
|
protected void |
writeMap(DBObject dbo,
String mapKey,
Map<String,Object> map)
Deprecated. Writes the given Map to the given DBObject. |
|
| Methods inherited from class org.springframework.data.document.mongodb.convert.AbstractMongoConverter |
|---|
afterPropertiesSet, getConversionService, getCustomTarget, maybeConvertArray, maybeConvertList, maybeConvertObject, setCustomConverters |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.springframework.beans.factory.InitializingBean |
|---|
afterPropertiesSet |
| Constructor Detail |
|---|
public SimpleMongoConverter()
SimpleMongoConverter.
| Method Detail |
|---|
public org.springframework.data.mapping.model.MappingContext<? extends MongoPersistentEntity<?>,MongoPersistentProperty> getMappingContext()
getMappingContext in interface MongoConverter
public void write(Object obj,
DBObject dbo)
MongoWriter
write in interface MongoWriter<Object>obj - The object to convert to a DBObjectdbo - The DBObject to use for writing.
protected void writeMap(DBObject dbo,
String mapKey,
Map<String,Object> map)
Map to the given DBObject.
dbo - mapKey - map -
protected void writeArray(DBObject dbo,
String keyToUse,
Object[] array)
DBObject.
dbo - keyToUse - array -
public <S> S read(Class<S> clazz,
DBObject source)
MongoReaderDBObject into it. So in case there's no real valid data inside
DBObject for the given type, just return an empty instance of the given type.
read in interface MongoReader<Object>clazz - the type of the return valuesource - theDBObject
protected Map<String,Object> createMap()
Map instance. Will return a HashMap by default. Subclasses might want to override this
method to use a custom Map implementation.
protected Map<?,?> readMap(MongoPropertyDescriptors.MongoPropertyDescriptor pd,
DBObject dbo,
Class<?> targetType)
DBObject into a Map instance.
pd - dbo - targetType -
protected static boolean isSimpleType(Class<?> propertyType)
protected org.springframework.data.document.mongodb.convert.MongoBeanWrapper createWrapper(Object target,
boolean fieldAccess)
MongoBeanWrapper.
target - the target object to wrapfieldAccess - whether to use field access or property access
public List<Class<?>> getGenericParameters(Type genericParameterType)
public <T> T convertObjectId(ObjectId id,
Class<T> targetType)
MongoConverterObjectId to the given target type.
convertObjectId in interface MongoConverterT - the actual type to createid - the source ObjectIdtargetType - the target type to convert the ObjectId to
public ObjectId convertObjectId(Object id)
MongoConverterObjectId instance for the given id.
convertObjectId in interface MongoConverter
|
Spring Data Document | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||