官方原文:
Goals:
By removing apt from the JDK, annotation processing can finish transitioning
to the superior, standardized JSR 269 API.
The apt annotation processing framework is JDK-specific and dates back to JDK
5. The functionality of the API was standardized with JSR 269, which shipped
as part of Java SE 6. In JDK 7, the entirety of the apt API was deprecated.
Impacts:
After this change, users of annotation processing will have to use the JSR
269 annotation processing facility, which has been supported in javac since
JDK 6. Since apt is just part of the JDK and not part of Java SE, there is a
looser compatibility contract around this component than around an API in
java.* or javax.*. The removal of a command line tool from the JDK is not
unprecedented, but the removal of apt should be clearly described in the
release notes and similar documents.
意味着Java8以后不再默认包含APT了,并且相关的资源都被移除了比如Mirror相关类,取而代之的是Pluggable Annotation Processing API,新的API使用方式略有不同,但是思想统一,操作起来还是比较方便的。
学习资源:
最近就使用新的Pluggable Annotation Processing API写了一个编译时注解处理的库,感兴趣的可以去github(地址)下载,拜托给个Start吧/(ㄒoㄒ)/~~,写了好久了,有任何问题,欢迎留言~
本文介绍Java 8中对APT(Annotation Processing Tool)的移除及其替代方案——标准化的JSR 269 API。APT作为JDK特有的组件,在Java 5引入并随Java SE 6标准化为JSR 269 API。从Java 7开始,APT被标记为废弃,并在Java 8中完全移除。文章还提到了这一变化的影响以及新的Pluggable Annotation Processing API的学习资源。
471

被折叠的 条评论
为什么被折叠?



