Class AnnotationUtils

java.lang.Object
com.ultikits.ultitools.utils.AnnotationUtils

public class AnnotationUtils extends Object
Utility class for annotation processing operations. Provides methods to find annotations on classes including inherited annotations.
注解处理实用工具类。 提供在类上查找注解的方法,包括继承的注解。
Since:
6.0.0
Author:
wisdomme
  • Constructor Details

    • AnnotationUtils

      private AnnotationUtils()
      Private constructor to prevent instantiation.
      私有构造函数,防止实例化。
  • Method Details

    • findAnnotation

      public static <T extends Annotation> T findAnnotation(Class<?> clazz, Class<T> annotationType)
      Find an annotation on a class, searching up the inheritance hierarchy if not found directly.
      在类上查找注解,如果直接找不到则向上搜索继承层次结构。
      Type Parameters:
      T - the annotation type
      注解类型
      Parameters:
      clazz - the class to search for the annotation
      要搜索注解的类
      annotationType - the type of annotation to find
      要查找的注解类型
      Returns:
      the annotation if found, or null if not found
      如果找到则返回注解,否则返回null