Zu diesem Thema habe ich auch ein kleines Beispiel Projekt aufgesetzt. Dies findet sich unter: https://github.com/FunThomas424242/annotation-processor-plugin.example
This post is the second part in my series about Code Generation using Annotation Processors in the Java language. In part 1 (read it here) we introduced what Annotations are in the Java language and some of their common uses.
Now in part 2 we are going to introduce Annotation Processors, how to build them and how to run them.
Code Generation using Annotation Processors in the Java language – part 2: Annotation Processors
Annotations are great, sure. You can set any kind of metadata or configuration with them, with a well defined syntax and different types to use.
From what we have seen until now, annotations have advantages compared with Javadocs but not enough to justify their inclusion into the language. Therefore, is it possible to interact with annotations and get the most from them? Sure it is:
- At runtime, annotations with runtime retention policy are accessible through…
Ursprünglichen Post anzeigen 1.656 weitere Wörter