Generating Java Source Files with JavaPoet

For the most of us developers, generating Java source files is an occasionally happening task and we’re dealing with it e.g. when writing annotation processors, writing tools or interacting with meta-data files. JavaPoet is a nice library to simplify such tasks, offering an intuitive fluent-builder API to generate source files in no time. In the following tutorial I’d like to share a few examples by writing code generators with the help of this library. ...

February 28, 2015 · 5 min · 1035 words · Micha Kops