难以扩展龙目岛 [英] Difficulty extending Lombok
问题描述
我想创建一个注释处理程序来扩展Java语言.但是由于SCL文件,我不能轻易做到这一点.我想知道Lombok开发人员是否故意做到这一点.
I want to create an annotation handler to extend the Java language. However I can't do this easily, because of the SCL files. I wanted to know if the Lombok developers made it this hard on purpose.
如果我尝试扩展JavacAnnotationHandler,则在lombok.jar中找不到它,因为名称是JavacAnnotationHandler.SCL.Lombok.我克隆了GitHub存储库,但在package.java和Java 12语法中的resources.after和resources.before重复类中仍然遇到错误.我正在使用lombok 1.18.8.
If I try extending JavacAnnotationHandler, it can't find it in lombok.jar because the name is JavacAnnotationHandler.SCL.Lombok. I cloned the GitHub repository but I keep getting errors with duplicate classes in the resources.after and resources.before package and Java 12 syntax. I am using lombok 1.18.8.
这就是我所拥有的.
import lombok.javac.JavacAnnotationHandler;
public class SingletonJavacHandler extends JavacAnnotationHandler<Singleton> {
显示无法解析符号'JavacAnnotationHandler'"
It says "Cannot resolve symbol 'JavacAnnotationHandler'"
推荐答案
SCL文件将从IDE中的自动完成对话框中隐藏lombok实现类.
The SCL files are to hide lombok implementation classes from autocomplete dialogs in IDEs.
不应编译前资源和后资源文件.它们在测试资源中,因为我们的测试框架会对其进行处理.
The resources-before and resources-after files should not be compiled. They are in the test resources, because our testing framework processes them.
这篇关于难以扩展龙目岛的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!