Class BeanResourceHolder

    • Constructor Detail

      • BeanResourceHolder

        public BeanResourceHolder()
    • Method Detail

      • getAnnotation

        public static <T extends Annotation> T getAnnotation​(Method method,
                                                             Class<T> annotationType)
        解析方法标注的注解
        Type Parameters:
        T - 注解类型
        Parameters:
        method - 方法
        annotationType - 注解类
        Returns:
        注解
      • getAnnotation

        public static <T extends Annotation> T getAnnotation​(Class target,
                                                             Class<T> annotationType)
        解析类标注的注解
        Type Parameters:
        T - 注解类型
        Parameters:
        target - 目标类
        annotationType - 注解类
        Returns:
        注解
      • getAnnotation

        public static <T extends Annotation> T getAnnotation​(Method method,
                                                             Class<T> annotationType,
                                                             boolean allScope)
        解析方法或类标注的注解
        Type Parameters:
        T - 注解类型
        Parameters:
        method - 方法
        annotationType - 注解类
        allScope - 是否解析方法和类(如为 true, 解析方法和声明方法的类并按照"方法 > 类"的优先级返回, 如为 false, 只解析方法的注解)
        Returns:
        注解
      • findAnnotation

        public static <A extends Annotation> A findAnnotation​(AnnotatedElement element,
                                                              Class<A> annotationType,
                                                              boolean allScope)
        解析方法或类标注的注解
        Type Parameters:
        A - 注解类型
        Parameters:
        element - 目标
        annotationType - 注解类
        allScope - 是否解析方法和类(如为 true, 解析方法和声明方法的类并按照"方法 > 类"的优先级返回, 如为 false, 只解析方法的注解)
        Returns:
        注解
        See Also:
        AnnotatedElementUtils.findMergedAnnotation(AnnotatedElement, Class)