|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.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 DBObject
s.
Field Summary |
---|
Fields inherited from class org.springframework.data.document.mongodb.convert.AbstractMongoConverter |
---|
conversionService |
Constructor Summary | |
---|---|
SimpleMongoConverter()
Deprecated. Creates a SimpleMongoConverter . |
Method Summary | ||
---|---|---|
org.bson.types.ObjectId |
convertObjectId(java.lang.Object id)
Deprecated. Returns the ObjectId instance for the given id. |
|
|
convertObjectId(org.bson.types.ObjectId id,
java.lang.Class<T> targetType)
Deprecated. Converts the given ObjectId to the given target type. |
|
protected java.util.Map<java.lang.String,java.lang.Object> |
createMap()
Deprecated. Create a Map instance. |
|
protected org.springframework.data.document.mongodb.convert.MongoBeanWrapper |
createWrapper(java.lang.Object target,
boolean fieldAccess)
Deprecated. Callback to allow customizing creation of a MongoBeanWrapper . |
|
java.util.List<java.lang.Class<?>> |
getGenericParameters(java.lang.reflect.Type genericParameterType)
Deprecated. |
|
org.springframework.data.mapping.model.MappingContext<? extends MongoPersistentEntity<?>,MongoPersistentProperty> |
getMappingContext()
Deprecated. |
|
protected static boolean |
isSimpleType(java.lang.Class<?> propertyType)
Deprecated. |
|
|
read(java.lang.Class<S> clazz,
com.mongodb.DBObject source)
Deprecated. Ready from the native MongoDB DBObject representation to an instance of the class T. |
|
protected java.util.Map<?,?> |
readMap(MongoPropertyDescriptors.MongoPropertyDescriptor pd,
com.mongodb.DBObject dbo,
java.lang.Class<?> targetType)
Deprecated. Reads every key/value pair from the DBObject into a Map instance. |
|
void |
write(java.lang.Object obj,
com.mongodb.DBObject dbo)
Deprecated. Write the given object of type T to the native MongoDB object representation DBObject. |
|
protected void |
writeArray(com.mongodb.DBObject dbo,
java.lang.String keyToUse,
java.lang.Object[] array)
Deprecated. Writes the given array to the given DBObject . |
|
protected void |
writeMap(com.mongodb.DBObject dbo,
java.lang.String mapKey,
java.util.Map<java.lang.String,java.lang.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(java.lang.Object obj, com.mongodb.DBObject dbo)
MongoWriter
write
in interface MongoWriter<java.lang.Object>
obj
- The object to convert to a DBObjectdbo
- The DBObject to use for writing.protected void writeMap(com.mongodb.DBObject dbo, java.lang.String mapKey, java.util.Map<java.lang.String,java.lang.Object> map)
Map
to the given DBObject
.
dbo
- mapKey
- map
- protected void writeArray(com.mongodb.DBObject dbo, java.lang.String keyToUse, java.lang.Object[] array)
DBObject
.
dbo
- keyToUse
- array
- public <S> S read(java.lang.Class<S> clazz, com.mongodb.DBObject source)
MongoReader
DBObject
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<java.lang.Object>
clazz
- the type of the return valuesource
- theDBObject
protected java.util.Map<java.lang.String,java.lang.Object> createMap()
Map
instance. Will return a HashMap
by default. Subclasses might want to override this
method to use a custom Map
implementation.
protected java.util.Map<?,?> readMap(MongoPropertyDescriptors.MongoPropertyDescriptor pd, com.mongodb.DBObject dbo, java.lang.Class<?> targetType)
DBObject
into a Map
instance.
pd
- dbo
- targetType
-
protected static boolean isSimpleType(java.lang.Class<?> propertyType)
protected org.springframework.data.document.mongodb.convert.MongoBeanWrapper createWrapper(java.lang.Object target, boolean fieldAccess)
MongoBeanWrapper
.
target
- the target object to wrapfieldAccess
- whether to use field access or property access
public java.util.List<java.lang.Class<?>> getGenericParameters(java.lang.reflect.Type genericParameterType)
public <T> T convertObjectId(org.bson.types.ObjectId id, java.lang.Class<T> targetType)
MongoConverter
ObjectId
to the given target type.
convertObjectId
in interface MongoConverter
T
- the actual type to createid
- the source ObjectId
targetType
- the target type to convert the ObjectId
to
public org.bson.types.ObjectId convertObjectId(java.lang.Object id)
MongoConverter
ObjectId
instance for the given id.
convertObjectId
in interface MongoConverter
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |