public interface AnnotationScanner
TypeAnnotationScanner,
MethodAnnotationScanner,
FieldAnnotationScanner,
MetaAnnotationScanner| 限定符和类型 | 方法和说明 |
|---|---|
List<Annotation> |
getAnnotations(AnnotatedElement annotatedElement)
获取可注解元素上的全部注解。
|
default List<Annotation> |
getIfSupport(AnnotatedElement annotatedElement)
若
support(AnnotatedElement)返回true,
则调用并返回getAnnotations(AnnotatedElement)结果,
否则返回Collections.emptyList() |
static List<Annotation> |
scanByAllScanner(AnnotatedElement annotatedElement,
AnnotationScanner... scanners)
根据指定的扫描器,扫描元素上可能存在的注解
|
static List<Annotation> |
scanByAnySupported(AnnotatedElement annotatedElement,
AnnotationScanner... scanners)
给定一组扫描器,使用第一个支持处理该类型元素的扫描器获取元素上可能存在的注解
|
default boolean |
support(AnnotatedElement annotatedElement)
是否支持扫描该可注解元素
|
default boolean support(AnnotatedElement annotatedElement)
annotatedElement - 可注解元素List<Annotation> getAnnotations(AnnotatedElement annotatedElement)
support(AnnotatedElement)返回为trueannotatedElement - 可注解元素default List<Annotation> getIfSupport(AnnotatedElement annotatedElement)
support(AnnotatedElement)返回true,
则调用并返回getAnnotations(AnnotatedElement)结果,
否则返回Collections.emptyList()annotatedElement - 元素static List<Annotation> scanByAnySupported(AnnotatedElement annotatedElement, AnnotationScanner... scanners)
annotatedElement - 可注解元素scanners - 注解扫描器static List<Annotation> scanByAllScanner(AnnotatedElement annotatedElement, AnnotationScanner... scanners)
annotatedElement - 可注解元素scanners - 注解扫描器Copyright © 2022. All rights reserved.