Difficulty extending Lombok

℡╲_俬逩灬. 提交于 2020-05-15 06:46:38

问题


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.

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.

This is what I have.

    import lombok.javac.JavacAnnotationHandler;
    public class SingletonJavacHandler extends JavacAnnotationHandler<Singleton> {

It says "Cannot resolve symbol 'JavacAnnotationHandler'"


回答1:


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.



来源:https://stackoverflow.com/questions/57365535/difficulty-extending-lombok

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!