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 {
private final Class<T> type; private final Class<T> type;
public ReadDbObjectCallback(MongoReader<? super T> reader, Class<T> type) { public ReadDbObjectCallback(MongoReader<? super T> reader, Class<T> type) {
Assert.notNull(reader);
Assert.notNull(type);
this.reader = reader; this.reader = reader;
this.type = type; 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;
/** /**
* A MongoWriter is responsible for converting a native MongoDB DBObject to an object of type T. * A MongoWriter is responsible for converting a native MongoDB DBObject to an object of type T.
* *
* @param <T> * @param <T> the type of the object to convert from a DBObject
* the type of the object to convert from a DBObject
* @author Mark Pollack * @author Mark Pollack
* @author Thomas Risberg * @author Thomas Risberg
* @author Oliver Gierke * @author Oliver Gierke
@ -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 * 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. * {@link DBObject} for the given type, just return an empty instance of the given type.
* *
* @param clazz * @param clazz the type of the return value. Will never be {@literal null}.
* the type of the return value * @param dbo the {@link DBObject} to convert into a domain object. Might be {@literal null}.
* @param dbo * @return the converted object. Might be {@literal null}.
* theDBObject
* @return the converted object
*/ */
<S extends T> S read(Class<S> clazz, DBObject dbo); <S extends T> S read(Class<S> clazz, DBObject dbo);
} }

Loading…
Cancel
Save