Using JavaPoet ?
What do you think about using JavaPoet to generate java source code ? I recommend this article about generation of java code (with JavaPoet).
I'm not sure it is applicable as the generator exposes templates that users can change as they wish (as long as it still generates working code).
An alternative here can also be: javaparser. It allows for creating AST from snippets of code as well, so I think it should work with the templates quite easily.
We can try that as a spike, my main concern is to keep the flexibility of the template mechanism that allows users to change the generated code relatively easily.
I would also advocate usage of JavaPoet. In order to stay compatible with template files, i would suggest first generating classes as usual and then using JavaPoet to model them, along with original classes, adding plugin abstraction allowing more complex code modifications, like for example conditional method generation based on property type