Search in sources :

Example 1 with DecoratingProxy

use of org.springframework.core.DecoratingProxy in project spring-framework by spring-projects.

the class AnnotationAwareOrderComparator method findOrderFromAnnotation.

@Nullable
private Integer findOrderFromAnnotation(Object obj) {
    AnnotatedElement element = (obj instanceof AnnotatedElement ? (AnnotatedElement) obj : obj.getClass());
    MergedAnnotations annotations = MergedAnnotations.from(element, SearchStrategy.TYPE_HIERARCHY);
    Integer order = OrderUtils.getOrderFromAnnotations(element, annotations);
    if (order == null && obj instanceof DecoratingProxy) {
        return findOrderFromAnnotation(((DecoratingProxy) obj).getDecoratedClass());
    }
    return order;
}
Also used : DecoratingProxy(org.springframework.core.DecoratingProxy) AnnotatedElement(java.lang.reflect.AnnotatedElement) Nullable(org.springframework.lang.Nullable)

Aggregations

AnnotatedElement (java.lang.reflect.AnnotatedElement)1 DecoratingProxy (org.springframework.core.DecoratingProxy)1 Nullable (org.springframework.lang.Nullable)1