Polishing

This commit is contained in:
Juergen Hoeller
2014-07-08 00:59:31 +02:00
parent 1115374188
commit 01264dc673
8 changed files with 78 additions and 69 deletions

View File

@@ -38,6 +38,7 @@ public class DefaultOrderProviderComparator implements OrderProviderComparator {
*/
public static final DefaultOrderProviderComparator INSTANCE = new DefaultOrderProviderComparator();
@Override
public void sortList(List<?> items, OrderProvider orderProvider) {
Collections.sort(items, new OrderProviderAwareComparator(orderProvider));
@@ -53,7 +54,7 @@ public class DefaultOrderProviderComparator implements OrderProviderComparator {
private final OrderProvider orderProvider;
private OrderProviderAwareComparator(OrderProvider orderProvider) {
public OrderProviderAwareComparator(OrderProvider orderProvider) {
this.orderProvider = orderProvider;
}

View File

@@ -21,8 +21,8 @@ import java.lang.annotation.Annotation;
import org.springframework.util.ClassUtils;
/**
* General utility for determining the order of an object based
* on its type declaration.
* General utility for determining the order of an object based on its type declaration.
* Handles Spring's {@link Order} annotation as well as {@link javax.annotation.Priority}.
*
* @author Stephane Nicoll
* @since 4.1
@@ -36,6 +36,7 @@ public abstract class OrderUtils {
private static final boolean priorityPresent =
ClassUtils.isPresent(PRIORITY_ANNOTATION_CLASS_NAME, OrderUtils.class.getClassLoader());
/**
* Return the order on the specified {@code type} or the specified
* default value if none can be found.
@@ -56,8 +57,8 @@ public abstract class OrderUtils {
}
/**
* Return the value of the {@code javax.annotation.Priority} annotation set on the
* specified type or {@code null} if none is set.
* Return the value of the {@code javax.annotation.Priority} annotation set
* on the specified type or {@code null} if none is set.
* @param type the type to handle
* @return the priority value if the annotation is set, {@code null} otherwise
*/