You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 13, 2021. It is now read-only.
###记录几个发现###
1:AbstractProcessor是本开源项目的核心类,在build过程中,会执行该类的重写方法。process()是该类的核心方法,这相当于每个处理器的主函数main()。你在这里写你的扫描、评估和处理注解的代码,以及生成Java文件。输入参数RoundEnviroment,可以让你查询出包含特定注解的被注解元素。
2:之前在检测类元素的时候,判断是这么写的。
这么写并不合理,因为所有的元素类型都是Element,所有要避免使用instanceof。配合TypeMirror使用EmentKind或者TypeKind。
3:我们在遍历获取类文件里边的元素时,首先获取的是构造函数。
4:以下是获取注解的代码,返回一个集合
5:以下是获取注解类型的代码
6:以下是获取注解值的代码,返回一个map
7:创建一个新的注解
8:messager打印的时候遇到一个问题,最后打印的数据貌似会把之前的数据覆盖,导致在for循环的时候,我一直认为数据是不对的,很坑爹。
The text was updated successfully, but these errors were encountered: