Custom Annotations and Annotation Processors in Java: Generate Code at Compile Time
Retention, targets and meta-annotations, runtime reflection versus compile-time processing, and a complete @GenerateBuilder annotation processor: Filer, Messager, compile errors with real javac output, in-memory tests with javax.tools, and the JDK 23+ trap where a processor on the classpath silently stops running (reproduced on JDK 25).