Browse Source

DATADOC-239 - Clarify documentation of passed in values for MongoReader.

pull/1/head
Oliver Gierke 15 years ago
parent
commit
d237ee80c8
  1. 2
      spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/MongoTemplate.java
  2. 11
      spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/convert/MongoReader.java

2
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/MongoTemplate.java

@ -1252,6 +1252,8 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware { @@ -1252,6 +1252,8 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware {
private final Class<T> type;
public ReadDbObjectCallback(MongoReader<? super T> reader, Class<T> type) {
Assert.notNull(reader);
Assert.notNull(type);
this.reader = reader;
this.type = type;
}

11
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/convert/MongoReader.java

@ -20,8 +20,7 @@ import com.mongodb.DBObject; @@ -20,8 +20,7 @@ import com.mongodb.DBObject;
/**
* A MongoWriter is responsible for converting a native MongoDB DBObject to an object of type T.
*
* @param <T>
* the type of the object to convert from a DBObject
* @param <T> the type of the object to convert from a DBObject
* @author Mark Pollack
* @author Thomas Risberg
* @author Oliver Gierke
@ -33,11 +32,9 @@ public interface MongoReader<T> { @@ -33,11 +32,9 @@ public interface MongoReader<T> {
* starting point for marshalling the {@link DBObject} into it. So in case there's no real valid data inside
* {@link DBObject} for the given type, just return an empty instance of the given type.
*
* @param clazz
* the type of the return value
* @param dbo
* theDBObject
* @return the converted object
* @param clazz the type of the return value. Will never be {@literal null}.
* @param dbo the {@link DBObject} to convert into a domain object. Might be {@literal null}.
* @return the converted object. Might be {@literal null}.
*/
<S extends T> S read(Class<S> clazz, DBObject dbo);
}

Loading…
Cancel
Save