The Epsilon Generation Language (EGL) can be used to produce text from models. That text could be HTML, Java code or anything you want. Could you take a look at this page, and chapter 7 of the Epsilon book?
We have some beautifiers for Java code, but you'd need to write most of the code generation process yourself.
Alternatively, you could use a model-to-model transformation (using the Epsilon Transformation Language, for instance) to produce a model of a Java program according to the MoDisco Java metamodel and then save it to a set of .java files. I think MoDisco provides the model-to-text transformation itself. I haven't tried it myself, but it could be useful for you .