public class ElementAnnotationScanner extends Object implements AnnotationScanner
AnnotatedElement上的注解,不支持处理层级对象DIRECTLY, DIRECTLY_AND_META_ANNOTATION, INTERFACE, INTERFACE_AND_META_ANNOTATION, NOTHING, SUPERCLASS, SUPERCLASS_AND_META_ANNOTATION, TYPE_HIERARCHY, TYPE_HIERARCHY_AND_META_ANNOTATION| Constructor and Description |
|---|
ElementAnnotationScanner() |
| Modifier and Type | Method and Description |
|---|---|
void |
scan(BiConsumer<Integer,Annotation> consumer,
AnnotatedElement annotatedEle,
Predicate<Annotation> filter)
扫描
AnnotatedElement上直接声明的注解,调用前需要确保调用support(AnnotatedElement)返回为true |
boolean |
support(AnnotatedElement annotatedEle)
判断是否支持扫描该注解元素,仅当注解元素不为空时返回
true |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetAnnotations, getAnnotationsIfSupport, scanByAllSupported, scanByAnySupported, scanIfSupportpublic boolean support(AnnotatedElement annotatedEle)
truesupport in interface AnnotationScannerannotatedEle - AnnotatedElement,可以是Class、Method、Field、Constructor、ReflectPermissionpublic void scan(BiConsumer<Integer,Annotation> consumer, AnnotatedElement annotatedEle, Predicate<Annotation> filter)
AnnotatedElement上直接声明的注解,调用前需要确保调用support(AnnotatedElement)返回为truescan in interface AnnotationScannerconsumer - 对获取到的注解和注解对应的层级索引的处理annotatedEle - AnnotatedElement,可以是Class、Method、Field、Constructor、ReflectPermissionfilter - 注解过滤器,无法通过过滤器的注解不会被处理。该参数允许为空。Copyright © 2025. All rights reserved.