T - 收集的对象类型public class AnnotationCollector<T> extends Object implements AnnotationProcessor
用于在AbstractAnnotationScanner扫描过程中收集注解的注解处理器,
完成扫描后,用户可以通过#getTargets()获得按照被扫描的顺序排序的注解对象
| 构造器和说明 |
|---|
AnnotationCollector(Function3<Integer,Integer,Annotation,T> converter)
构造一个注解收集器
|
| 限定符和类型 | 方法和说明 |
|---|---|
void |
accept(int verticalIndex,
int horizontalIndex,
Annotation annotation)
处理注解,若获得的对象不为null,则将其添加到
targets中 |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitinterruptedpublic AnnotationCollector(Function3<Integer,Integer,Annotation,T> converter)
converter - 转换器public void accept(int verticalIndex,
int horizontalIndex,
Annotation annotation)
targets中accept 在接口中 AnnotationProcessorverticalIndex - 垂直索引。一般表示与扫描器扫描的AnnotatedElement相隔的层级层次。默认从1开始horizontalIndex - 水平索引,一般用于衡量两个注解对象之间被扫描到的先后顺序。默认从1开始annotation - 被扫描到的注解对象Copyright © 2022. All rights reserved.