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