Search in sources :

Example 1 with DecoratingProxy

use of cn.taketoday.core.DecoratingProxy in project today-infrastructure by TAKETODAY.

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(cn.taketoday.core.DecoratingProxy) AnnotatedElement(java.lang.reflect.AnnotatedElement) Nullable(cn.taketoday.lang.Nullable)

Example 2 with DecoratingProxy

use of cn.taketoday.core.DecoratingProxy in project today-framework by TAKETODAY.

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(cn.taketoday.core.DecoratingProxy) AnnotatedElement(java.lang.reflect.AnnotatedElement) Nullable(cn.taketoday.lang.Nullable)

Aggregations

DecoratingProxy (cn.taketoday.core.DecoratingProxy)2 Nullable (cn.taketoday.lang.Nullable)2 AnnotatedElement (java.lang.reflect.AnnotatedElement)2