问题
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