DATACMNS-265 - Polished JavaDoc.

This commit is contained in:
Oliver Gierke
2013-01-11 11:35:02 +01:00
parent 68ef3c68b0
commit c908d0e023
16 changed files with 70 additions and 71 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2011 the original author or authors.
* Copyright 2011-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -88,7 +88,7 @@ public class DefaultTypeMapper<S> implements TypeMapper<S> {
/*
* (non-Javadoc)
* @see org.springframework.data.mongodb.core.convert.MongoTypeMapper#readType(com.mongodb.DBObject)
* @see org.springframework.data.convert.TypeMapper#readType(java.lang.Object)
*/
public TypeInformation<?> readType(S source) {
@@ -159,7 +159,7 @@ public class DefaultTypeMapper<S> implements TypeMapper<S> {
/*
* (non-Javadoc)
* @see org.springframework.data.mongodb.core.convert.MongoTypeMapper#writeType(java.lang.Class, com.mongodb.DBObject)
* @see org.springframework.data.convert.TypeMapper#writeType(java.lang.Class, java.lang.Object)
*/
public void writeType(Class<?> type, S dbObject) {
writeType(ClassTypeInformation.from(type), dbObject);
@@ -167,7 +167,7 @@ public class DefaultTypeMapper<S> implements TypeMapper<S> {
/*
* (non-Javadoc)
* @see org.springframework.data.mongodb.core.convert.MongoTypeMapper#writeType(java.lang.Class, com.mongodb.DBObject)
* @see org.springframework.data.convert.TypeMapper#writeType(org.springframework.data.util.TypeInformation, java.lang.Object)
*/
public void writeType(TypeInformation<?> info, S sink) {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012 the original author or authors.
* Copyright 2012-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -20,7 +20,7 @@ import org.springframework.data.mapping.PersistentProperty;
import org.springframework.data.mapping.model.ParameterValueProvider;
/**
* SPI to abstract strategies to create instances for {@link PersistentEntities}.
* SPI to abstract strategies to create instances for {@link PersistentEntity}s.
*
* @author Oliver Gierke
*/

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012 the original author or authors.
* Copyright 2012-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -29,7 +29,7 @@ import org.springframework.data.mapping.model.MappingInstantiationException;
import org.springframework.data.mapping.model.ParameterValueProvider;
/**
* {@link EntityInstantiator} that uses the {@link PersistentEntity}'s {@link MappedConstructor} to instantiate an
* {@link EntityInstantiator} that uses the {@link PersistentEntity}'s {@link PreferredConstructor} to instantiate an
* instance of the entity via reflection.
*
* @author Oliver Gierke
@@ -72,7 +72,7 @@ public enum ReflectionEntityInstantiator implements EntityInstantiator {
}
try {
return (T) BeanUtils.instantiateClass(constructor.getConstructor(), params.toArray());
return BeanUtils.instantiateClass(constructor.getConstructor(), params.toArray());
} catch (BeanInstantiationException e) {
throw new MappingInstantiationException(e.getMessage(), e);
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2008-2010 the original author or authors.
* Copyright 2008-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -26,7 +26,7 @@ import org.springframework.util.StringUtils;
/**
* Sort option for queries. You have to provide at least a list of properties to sort for that must not include
* {@literal null} or empty strings. The direction defaults to {@value Sort#DEFAULT_DIRECTION}.
* {@literal null} or empty strings. The direction defaults to {@link Sort#DEFAULT_DIRECTION}.
*
* @author Oliver Gierke
*/
@@ -72,7 +72,7 @@ public class Sort implements Iterable<org.springframework.data.domain.Sort.Order
/**
* Creates a new {@link Sort} instance.
*
* @param direction defaults to {@value Sort#DEFAULT_DIRECTION} (for {@literal null} cases, too)
* @param direction defaults to {@linke Sort#DEFAULT_DIRECTION} (for {@literal null} cases, too)
* @param properties must not be {@literal null} or contain {@literal null} or empty strings
*/
public Sort(Direction direction, String... properties) {
@@ -227,9 +227,9 @@ public class Sort implements Iterable<org.springframework.data.domain.Sort.Order
/**
* Creates a new {@link Order} instance. if order is {@literal null} then order defaults to
* {@value Sort#DEFAULT_DIRECTION}
* {@link Sort#DEFAULT_DIRECTION}
*
* @param direction can be {@literal null}, will default to {@value Sort#DEFAULT_DIRECTION}
* @param direction can be {@literal null}, will default to {@link Sort#DEFAULT_DIRECTION}
* @param property must not be {@literal null} or empty.
*/
public Order(Direction direction, String property) {
@@ -244,7 +244,7 @@ public class Sort implements Iterable<org.springframework.data.domain.Sort.Order
/**
* Creates a new {@link Order} instance. Takes a single property. Direction defaults to
* {@value Sort#DEFAULT_DIRECTION}.
* {@link Sort#DEFAULT_DIRECTION}.
*
* @param property must not be {@literal null} or empty.
*/

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2011-2012 by the original author(s).
* Copyright 2011-2013 by the original author(s).
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -33,7 +33,7 @@ import org.springframework.util.StringUtils;
* Value object to encapsulate the constructor to be used when mapping persistent data to objects.
*
* @author Oliver Gierke
* @author Jon Brisbin <jbrisbin@vmware.com>
* @author Jon Brisbin
*/
public class PreferredConstructor<T, P extends PersistentProperty<P>> {
@@ -105,7 +105,7 @@ public class PreferredConstructor<T, P extends PersistentProperty<P>> {
/**
* Returns whether the given {@link PersistentProperty} is referenced in a constructor argument of the
* {@link PersistentEntity} backing this {@link MappedConstructor}.
* {@link PersistentEntity} backing this {@link PreferredConstructor}.
*
* @param property must not be {@literal null}.
* @return

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2011 the original author or authors.
* Copyright 2011-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -58,7 +58,6 @@ public interface RepositoryInformation extends RepositoryMetadata {
/**
* Returns all methods considered to be query methods.
*
* @param repositoryInterface
* @return
*/
Iterable<Method> getQueryMethods();

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2008-2012 the original author or authors.
* Copyright 2008-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -34,9 +34,9 @@ import org.springframework.data.repository.core.NamedQueries;
import org.springframework.data.repository.core.RepositoryInformation;
import org.springframework.data.repository.core.RepositoryMetadata;
import org.springframework.data.repository.query.QueryLookupStrategy;
import org.springframework.data.repository.query.QueryLookupStrategy.Key;
import org.springframework.data.repository.query.QueryMethod;
import org.springframework.data.repository.query.RepositoryQuery;
import org.springframework.data.repository.query.QueryLookupStrategy.Key;
import org.springframework.data.repository.util.ClassUtils;
import org.springframework.util.Assert;
@@ -63,10 +63,9 @@ public abstract class RepositoryFactorySupport {
/**
* Sets the strategy of how to lookup a query to execute finders.
*
* @param queryLookupStrategy the createFinderQueries to set
* @param key
*/
public void setQueryLookupStrategyKey(Key key) {
this.queryLookupStrategyKey = key;
}
@@ -164,7 +163,7 @@ public abstract class RepositoryFactorySupport {
/**
* Returns the {@link RepositoryInformation} for the given repository interface.
*
* @param repositoryInterface
* @param metadata
* @param customImplementationClass
* @return
*/

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012 the original author or authors.
* Copyright 2012-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -62,7 +62,7 @@ public class JacksonResourceReader implements ResourceReader {
/**
* Configures the JSON document's key to lookup the type to instantiate the object. Defaults to
* {@value JacksonResourceReader#DEFAULT_TYPE_KEY}.
* {@link JacksonResourceReader#DEFAULT_TYPE_KEY}.
*
* @param typeKey
*/

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012 the original author or authors.
* Copyright 2012-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -64,11 +64,11 @@ public class ResourceReaderRepositoryPopulator implements RepositoryPopulator, A
* @param reader must not be {@literal null}.
* @param classLoader
*/
public ResourceReaderRepositoryPopulator(ResourceReader resourceReader, ClassLoader classLoader) {
public ResourceReaderRepositoryPopulator(ResourceReader reader, ClassLoader classLoader) {
Assert.notNull(resourceReader);
Assert.notNull(reader);
this.reader = resourceReader;
this.reader = reader;
this.classLoader = classLoader;
this.resolver = classLoader == null ? new PathMatchingResourcePatternResolver()
: new PathMatchingResourcePatternResolver(classLoader);

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2008-2010 the original author or authors.
* Copyright 2008-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -17,7 +17,6 @@ package org.springframework.data.repository.query;
import static java.lang.String.*;
import java.lang.annotation.Annotation;
import java.util.Arrays;
import java.util.List;
@@ -45,13 +44,9 @@ public class Parameter {
private final MethodParameter parameter;
/**
* Creates a new {@link Parameter} for the given type, {@link Annotation}s, positioned at the given index inside the
* given {@link Parameters}.
* Creates a new {@link Parameter} for the given {@link MethodParameter}.
*
* @param type
* @param parameters
* @param index
* @param name
* @param parameter must not be {@literal null}.
*/
protected Parameter(MethodParameter parameter) {
@@ -70,19 +65,16 @@ public class Parameter {
* @return
*/
boolean isFirst() {
return getIndex() == 0;
}
/**
* Returns whether the parameter is a special parameter.
*
* @param index
* @return
* @see #TYPES
*/
public boolean isSpecialParameter() {
return TYPES.contains(parameter.getParameterType());
}
@@ -92,14 +84,12 @@ public class Parameter {
* @return
*/
public boolean isBindable() {
return !isSpecialParameter();
}
/**
* Returns the placeholder to be used for the parameter. Can either be a named one or positional.
*
* @param index
* @return
*/
public String getPlaceholder() {
@@ -117,18 +107,15 @@ public class Parameter {
* @return
*/
public int getIndex() {
return parameter.getParameterIndex();
}
/**
* Returns whether the parameter is annotated with {@link Param}.
*
* @param index
* @return
*/
public boolean isNamedParameter() {
return !isSpecialParameter() && getName() != null;
}
@@ -138,6 +125,7 @@ public class Parameter {
* @return
*/
public String getName() {
Param annotation = parameter.getParameterAnnotation(Param.class);
return annotation == null ? parameter.getParameterName() : annotation.value();
}
@@ -157,7 +145,6 @@ public class Parameter {
*/
@Override
public String toString() {
return format("%s:%s", isNamedParameter() ? getName() : "#" + getIndex(), getType().getName());
}
@@ -167,7 +154,6 @@ public class Parameter {
* @return
*/
boolean isPageable() {
return Pageable.class.isAssignableFrom(getType());
}
@@ -177,7 +163,6 @@ public class Parameter {
* @return
*/
boolean isSort() {
return Sort.class.isAssignableFrom(getType());
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2008-2011 the original author or authors.
* Copyright 2008-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -77,7 +77,7 @@ public abstract class AbstractQueryCreator<T, S> {
* Creates the actual query object applying the given {@link Sort} parameter. Use this method in case you haven't
* provided a {@link ParameterAccessor} in the first place but want to apply dynamic sorting nevertheless.
*
* @param sort
* @param dynamicSort
* @return
*/
public T createQuery(Sort dynamicSort) {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2008-2010 the original author or authors.
* Copyright 2008-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -29,7 +29,7 @@ import org.springframework.util.StringUtils;
/**
* A single part of a method name that has to be transformed into a query part. The actual transformation is defined by
* a {@link Type} that is determined from inspecting the given part. The query part can then be looked up via
* {@link #getQueryPart()}.
* {@link #getProperty()}.
*
* @author Oliver Gierke
*/
@@ -47,8 +47,7 @@ public class Part {
* start parameter index.
*
* @param part must not be {@literal null}.
* @param clazz must not be {@l
* @param clazz must not be {@literal null}.
*/
public Part(String part, Class<?> clazz) {
@@ -251,11 +250,10 @@ public class Part {
}
/**
* Returns whether the the type supports the given raw propertyPath. Default implementation checks whether the
* propertyPath ends with the registered keyword. Does not support the keyword if the propertyPath is a valid field
* as is.
* Returns whether the the type supports the given raw property. Default implementation checks whether the property
* ends with the registered keyword. Does not support the keyword if the property is a valid field as is.
*
* @param propertyPath
* @param property
* @return
*/
protected boolean supports(String property) {
@@ -324,4 +322,4 @@ public class Part {
*/
WHEN_POSSIBLE
}
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2008-2011 the original author or authors.
* Copyright 2008-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -41,7 +41,8 @@ public abstract class ClassUtils {
/**
* Returns whether the given class contains a property with the given name.
*
* @param fieldName
* @param type
* @param property
* @return
*/
public static boolean hasProperty(Class<?> type, String property) {

View File

@@ -1,3 +1,18 @@
/*
* Copyright 2011-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.data.util;
import java.lang.reflect.Type;
@@ -19,7 +34,8 @@ public abstract class ParentTypeAwareTypeInformation<S> extends TypeDiscoverer<S
* Creates a new {@link ParentTypeAwareTypeInformation}.
*
* @param type
* @param typeVariableMap
* @param parent
* @param map
*/
@SuppressWarnings("rawtypes")
protected ParentTypeAwareTypeInformation(Type type, TypeDiscoverer<?> parent, Map<TypeVariable, Type> map) {
@@ -32,6 +48,7 @@ public abstract class ParentTypeAwareTypeInformation<S> extends TypeDiscoverer<S
*
* @return
*/
@Override
@SuppressWarnings("rawtypes")
protected Map<TypeVariable, Type> getTypeVariableMap() {
return parent == null ? super.getTypeVariableMap() : parent.getTypeVariableMap();

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2008-2011 the original author or authors.
* Copyright 2008-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -56,7 +56,7 @@ public class PageableArgumentResolver implements WebArgumentResolver {
/**
* Setter to configure a fallback instance of {@link Pageable} that is being used to back missing parameters. Defaults
* to {@value #DEFAULT_PAGE_REQUEST}.
* to {@link #DEFAULT_PAGE_REQUEST}.
*
* @param fallbackPagable the fallbackPagable to set
*/

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2008-2012 the original author or authors.
* Copyright 2008-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -20,11 +20,11 @@ import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort.Direction;
/**
* Annotation to set defaults when injecting a {@link Pageable} into a controller method.
* Annotation to set defaults when injecting a {@link org.springframework.data.domain.Pageable} into a controller
* method.
*
* @author Oliver Gierke
*/
@@ -39,7 +39,7 @@ public @interface PageableDefaults {
int value() default 10;
/**
* The default-pagenumber the injected {@link org.synyx.hades.domain.Pageable} should get if no corresponding
* The default-pagenumber the injected {@link org.springframework.data.domain.Pageable} should get if no corresponding
* parameter defined in request (default is 0).
*/
int pageNumber() default 0;
@@ -52,7 +52,7 @@ public @interface PageableDefaults {
String[] sort() default {};
/**
* The direction to sort by. Defaults to {@link Direction#ASC.
* The direction to sort by. Defaults to {@link Direction#ASC}.
*
* @return
*/