DATACMNS-1551 - Polishing.

Formatting.
This commit is contained in:
Oliver Drotbohm
2019-07-01 14:15:55 +02:00
parent 6959234b55
commit 8aad8e63bf
2 changed files with 20 additions and 20 deletions

View File

@@ -35,7 +35,7 @@ import org.springframework.web.method.support.ModelAndViewContainer;
/** /**
* {@link HandlerMethodArgumentResolver} to automatically create {@link Sort} instances from request parameters or * {@link HandlerMethodArgumentResolver} to automatically create {@link Sort} instances from request parameters or
* {@link SortDefault} annotations. * {@link SortDefault} annotations.
* *
* @since 1.6 * @since 1.6
* @author Oliver Gierke * @author Oliver Gierke
* @author Thomas Darimont * @author Thomas Darimont
@@ -59,7 +59,7 @@ public class SortHandlerMethodArgumentResolver implements SortArgumentResolver {
/** /**
* Configure the request parameter to lookup sort information from. Defaults to {@code sort}. * Configure the request parameter to lookup sort information from. Defaults to {@code sort}.
* *
* @param sortParameter must not be {@literal null} or empty. * @param sortParameter must not be {@literal null} or empty.
*/ */
public void setSortParameter(String sortParameter) { public void setSortParameter(String sortParameter) {
@@ -71,7 +71,7 @@ public class SortHandlerMethodArgumentResolver implements SortArgumentResolver {
/** /**
* Configures the delimiter used to separate property references and the direction to be sorted by. Defaults to * Configures the delimiter used to separate property references and the direction to be sorted by. Defaults to
* {@code}, which means sort values look like this: {@code firstname,lastname,asc}. * {@code}, which means sort values look like this: {@code firstname,lastname,asc}.
* *
* @param propertyDelimiter must not be {@literal null} or empty. * @param propertyDelimiter must not be {@literal null} or empty.
*/ */
public void setPropertyDelimiter(String propertyDelimiter) { public void setPropertyDelimiter(String propertyDelimiter) {
@@ -83,14 +83,14 @@ public class SortHandlerMethodArgumentResolver implements SortArgumentResolver {
/** /**
* Configures the delimiter used to separate the qualifier from the sort parameter. Defaults to {@code _}, so a * Configures the delimiter used to separate the qualifier from the sort parameter. Defaults to {@code _}, so a
* qualified sort property would look like {@code qualifier_sort}. * qualified sort property would look like {@code qualifier_sort}.
* *
* @param qualifierDelimiter the qualifier delimiter to be used or {@literal null} to reset to the default. * @param qualifierDelimiter the qualifier delimiter to be used or {@literal null} to reset to the default.
*/ */
public void setQualifierDelimiter(String qualifierDelimiter) { public void setQualifierDelimiter(String qualifierDelimiter) {
this.qualifierDelimiter = qualifierDelimiter == null ? DEFAULT_QUALIFIER_DELIMITER : qualifierDelimiter; this.qualifierDelimiter = qualifierDelimiter == null ? DEFAULT_QUALIFIER_DELIMITER : qualifierDelimiter;
} }
/* /*
* (non-Javadoc) * (non-Javadoc)
* @see org.springframework.web.method.support.HandlerMethodArgumentResolver#supportsParameter(org.springframework.core.MethodParameter) * @see org.springframework.web.method.support.HandlerMethodArgumentResolver#supportsParameter(org.springframework.core.MethodParameter)
*/ */
@@ -126,7 +126,7 @@ public class SortHandlerMethodArgumentResolver implements SortArgumentResolver {
* Reads the default {@link Sort} to be used from the given {@link MethodParameter}. Rejects the parameter if both an * Reads the default {@link Sort} to be used from the given {@link MethodParameter}. Rejects the parameter if both an
* {@link SortDefaults} and {@link SortDefault} annotation is found as we cannot build a reliable {@link Sort} * {@link SortDefaults} and {@link SortDefault} annotation is found as we cannot build a reliable {@link Sort}
* instance then (property ordering). * instance then (property ordering).
* *
* @param parameter will never be {@literal null}. * @param parameter will never be {@literal null}.
* @return the default {@link Sort} instance derived from the parameter annotations or the configured fallback-sort * @return the default {@link Sort} instance derived from the parameter annotations or the configured fallback-sort
* {@link #setFallbackSort(Sort)}. * {@link #setFallbackSort(Sort)}.
@@ -160,7 +160,7 @@ public class SortHandlerMethodArgumentResolver implements SortArgumentResolver {
/** /**
* Creates a new {@link Sort} instance from the given {@link SortDefault} or appends it to the given {@link Sort} * Creates a new {@link Sort} instance from the given {@link SortDefault} or appends it to the given {@link Sort}
* instance if it's not {@literal null}. * instance if it's not {@literal null}.
* *
* @param sortDefault * @param sortDefault
* @param sortOrNull * @param sortOrNull
* @return * @return
@@ -179,7 +179,7 @@ public class SortHandlerMethodArgumentResolver implements SortArgumentResolver {
/** /**
* Returns the sort parameter to be looked up from the request. Potentially applies qualifiers to it. * Returns the sort parameter to be looked up from the request. Potentially applies qualifiers to it.
* *
* @param parameter will never be {@literal null}. * @param parameter will never be {@literal null}.
* @return * @return
*/ */
@@ -198,7 +198,7 @@ public class SortHandlerMethodArgumentResolver implements SortArgumentResolver {
* Parses the given sort expressions into a {@link Sort} instance. The implementation expects the sources to be a * Parses the given sort expressions into a {@link Sort} instance. The implementation expects the sources to be a
* concatenation of Strings using the given delimiter. If the last element can be parsed into a {@link Direction} it's * concatenation of Strings using the given delimiter. If the last element can be parsed into a {@link Direction} it's
* considered a {@link Direction} and a simple property otherwise. * considered a {@link Direction} and a simple property otherwise.
* *
* @param source will never be {@literal null}. * @param source will never be {@literal null}.
* @param delimiter the delimiter to be used to split up the source elements, will never be {@literal null}. * @param delimiter the delimiter to be used to split up the source elements, will never be {@literal null}.
* @return * @return
@@ -247,7 +247,7 @@ public class SortHandlerMethodArgumentResolver implements SortArgumentResolver {
/** /**
* Folds the given {@link Sort} instance into a {@link List} of sort expressions, accumulating {@link Order} instances * Folds the given {@link Sort} instance into a {@link List} of sort expressions, accumulating {@link Order} instances
* of the same direction into a single expression if they are in order. * of the same direction into a single expression if they are in order.
* *
* @param sort must not be {@literal null}. * @param sort must not be {@literal null}.
* @return * @return
*/ */
@@ -270,13 +270,13 @@ public class SortHandlerMethodArgumentResolver implements SortArgumentResolver {
builder.add(order.getProperty()); builder.add(order.getProperty());
} }
return builder == null ? Collections.<String>emptyList() : builder.dumpExpressionIfPresentInto(expressions); return builder == null ? Collections.<String> emptyList() : builder.dumpExpressionIfPresentInto(expressions);
} }
/** /**
* Folds the given {@link Sort} instance into two expressions. The first being the property list, the second being the * Folds the given {@link Sort} instance into two expressions. The first being the property list, the second being the
* direction. * direction.
* *
* @throws IllegalArgumentException if a {@link Sort} with multiple {@link Direction}s has been handed in. * @throws IllegalArgumentException if a {@link Sort} with multiple {@link Direction}s has been handed in.
* @param sort must not be {@literal null}. * @param sort must not be {@literal null}.
* @return * @return
@@ -300,12 +300,12 @@ public class SortHandlerMethodArgumentResolver implements SortArgumentResolver {
builder.add(order.getProperty()); builder.add(order.getProperty());
} }
return builder == null ? Collections.<String>emptyList() : builder.dumpExpressionIfPresentInto(expressions); return builder == null ? Collections.<String> emptyList() : builder.dumpExpressionIfPresentInto(expressions);
} }
/** /**
* Helper to easily build request parameter expressions for {@link Sort} instances. * Helper to easily build request parameter expressions for {@link Sort} instances.
* *
* @author Oliver Gierke * @author Oliver Gierke
*/ */
class ExpressionBuilder { class ExpressionBuilder {
@@ -315,7 +315,7 @@ public class SortHandlerMethodArgumentResolver implements SortArgumentResolver {
/** /**
* Sets up a new {@link ExpressionBuilder} for properties to be sorted in the given {@link Direction}. * Sets up a new {@link ExpressionBuilder} for properties to be sorted in the given {@link Direction}.
* *
* @param direction must not be {@literal null}. * @param direction must not be {@literal null}.
*/ */
public ExpressionBuilder(Direction direction) { public ExpressionBuilder(Direction direction) {
@@ -326,7 +326,7 @@ public class SortHandlerMethodArgumentResolver implements SortArgumentResolver {
/** /**
* Returns whether the given {@link Order} has the same direction as the current {@link ExpressionBuilder}. * Returns whether the given {@link Order} has the same direction as the current {@link ExpressionBuilder}.
* *
* @param order must not be {@literal null}. * @param order must not be {@literal null}.
* @return * @return
*/ */
@@ -336,7 +336,7 @@ public class SortHandlerMethodArgumentResolver implements SortArgumentResolver {
/** /**
* Adds the given property to the expression to be built. * Adds the given property to the expression to be built.
* *
* @param property * @param property
*/ */
public void add(String property) { public void add(String property) {
@@ -346,7 +346,7 @@ public class SortHandlerMethodArgumentResolver implements SortArgumentResolver {
/** /**
* Dumps the expression currently in build into the given {@link List} of {@link String}s. Will only dump it in case * Dumps the expression currently in build into the given {@link List} of {@link String}s. Will only dump it in case
* there are properties piled up currently. * there are properties piled up currently.
* *
* @param expressions * @param expressions
* @return * @return
*/ */
@@ -369,7 +369,7 @@ public class SortHandlerMethodArgumentResolver implements SortArgumentResolver {
* <p> * <p>
* If you set this to {@literal null}, be aware that you controller methods will get {@literal null} handed into them * If you set this to {@literal null}, be aware that you controller methods will get {@literal null} handed into them
* in case no {@link Sort} data can be found in the request. * in case no {@link Sort} data can be found in the request.
* *
* @param fallbackSort the {@link Sort} to be used as general fallback. * @param fallbackSort the {@link Sort} to be used as general fallback.
*/ */
public void setFallbackSort(Sort fallbackSort) { public void setFallbackSort(Sort fallbackSort) {

View File

@@ -38,7 +38,7 @@ import org.springframework.web.context.request.ServletWebRequest;
/** /**
* Unit tests for {@link SortHandlerMethodArgumentResolver}. * Unit tests for {@link SortHandlerMethodArgumentResolver}.
* *
* @since 1.6 * @since 1.6
* @author Oliver Gierke * @author Oliver Gierke
* @author Thomas Darimont * @author Thomas Darimont