类 OrderUtils

java.lang.Object
cn.taketoday.core.annotation.OrderUtils

public abstract class OrderUtils extends Object
General utility for determining the order of an object based on its type declaration. Handles Order annotation as well as Priority.
作者:
Stephane Nicoll, Juergen Hoeller, TODAY 2018-11-08 19:02
  • 构造器详细资料

    • OrderUtils

      public OrderUtils()
  • 方法详细资料

    • getOrderOrLowest

      public static int getOrderOrLowest(AnnotatedElement annotated)
      Get the order of the AnnotatedElement
      参数:
      annotated - AnnotatedElement
      返回:
      The order
    • getOrderOrLowest

      public static int getOrderOrLowest(Object obj)
      Get the order of the object
      参数:
      obj - object
      返回:
      The order
    • getOrder

      public static int getOrder(Class<?> type, int defaultOrder)
      Return the order on the specified type, or the specified default value if none can be found.

      Takes care of @Order and @jakarta.annotation.Priority.

      参数:
      type - the type to handle
      返回:
      the priority value, or the specified default order if none can be found
      另请参阅:
    • getOrder

      @Nullable public static Integer getOrder(Class<?> type, @Nullable Integer defaultOrder)
      Return the order on the specified type, or the specified default value if none can be found.

      Takes care of @Order and @jakarta.annotation.Priority.

      参数:
      type - the type to handle
      返回:
      the priority value, or the specified default order if none can be found
      另请参阅:
    • getOrder

      @Nullable public static Integer getOrder(Class<?> type)
      Return the order on the specified type.

      Takes care of @Order and @jakarta.annotation.Priority.

      参数:
      type - the type to handle
      返回:
      the order value, or null if none can be found
      另请参阅:
    • getOrder

      @Nullable public static Integer getOrder(AnnotatedElement element)
      Return the order declared on the specified element.

      Takes care of @Order and @jakarta.annotation.Priority.

      参数:
      element - the annotated element (e.g. type or method)
      返回:
      the order value, or null if none can be found
    • getPriority

      @Nullable public static Integer getPriority(Class<?> type)
      Return the value of the jakarta.annotation.Priority annotation declared on the specified type, or null if none.
      参数:
      type - the type to handle
      返回:
      the priority value if the annotation is declared, or null if none