接口 AnnotationHandler


public interface AnnotationHandler
从以下版本开始:
2023-02-25
作者:
唐振超
  • 方法详细资料

    • getAnnotation

      default <T extends Annotation> T getAnnotation(Class<?> beanClass, Class<T> annotationClass)
      从类上获取注解
      类型参数:
      T - 具体注解
      参数:
      beanClass - 类的class
      annotationClass - 要获取的注解class
      返回:
      注解
    • isAnnotationPresent

      default <T extends Annotation> boolean isAnnotationPresent(Class<?> beanClass, Class<T> annotationClass)
      判断类上是否存在注解
      类型参数:
      T - 具体注解
      参数:
      beanClass - 类的class
      annotationClass - 要获取的注解class
      返回:
      是否包含该注解
    • getAnnotation

      default <T extends Annotation> T getAnnotation(Field field, Class<T> annotationClass)
      从字段上获取注解
      类型参数:
      T - 具体注解
      参数:
      field - 字段
      annotationClass - 要获取的注解class
      返回:
      注解
    • isAnnotationPresent

      default <T extends Annotation> boolean isAnnotationPresent(Field field, Class<T> annotationClass)
      判断字段上是否存在注解
      类型参数:
      T - 具体注解
      参数:
      field - 字段
      annotationClass - 要获取的注解class
      返回:
      是否包含该注解
    • getAnnotation

      default <T extends Annotation> T getAnnotation(Method method, Class<T> annotationClass)
      从方法上获取注解
      类型参数:
      T - 具体注解
      参数:
      method - 方法
      annotationClass - 要获取的注解class
      返回:
      注解
    • isAnnotationPresent

      default <T extends Annotation> boolean isAnnotationPresent(Method method, Class<T> annotationClass)
      判断方法上是否存在注解
      类型参数:
      T - 具体注解
      参数:
      method - 方法
      annotationClass - 要获取的注解class
      返回:
      是否包含该注解