Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I think you could try the same technique used in <a href="http://projectlombok.org/" rel="nofollow noreferrer">Project Lombok</a></p> <p>It's approximately explained by the authors in <a href="https://dzone.com/articles/interview-lombok" rel="nofollow noreferrer">this interview</a>:</p> <blockquote> <p><em>What's going on under the hood? I.e., how does an annotation result in the boilerplate ending up in the bytecode?</em></p> <p><strong>Reinier</strong>: The annotation processor API only lets you create new files, it does not let you modify the file that has the annotation inside of it. Which is what Lombok does, so Lombok does not use the annotation processor API.</p> <p>Instead, Lombok uses the annotation processor API only as a mechanism to inject itself into the compilation process. All annotation processors are initialized early in the compilation process, and Lombok modifies javac when it is initialized as an annotation processor. We change only one thing: The AST (the raw source code, parsed into a tree form) is first handed off to Lombok, which generates whatever needs to be generated, before javac continues.</p> </blockquote> <p>and in <a href="https://stackoverflow.com/questions/6107197/how-lombok-works">How does lombok work?</a></p> <p>It's also possible to extend Project Lombok to your needs</p> <ul> <li><a href="http://www.ibm.com/developerworks/java/library/j-lombok/" rel="nofollow noreferrer">Custom AST transformations with Project Lombok</a></li> <li><a href="http://notatube.blogspot.com.es/2010/12/project-lombok-creating-custom.html" rel="nofollow noreferrer">Project Lombok: Creating Custom Transformations</a></li> </ul>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload