code2code is an eclipse plugin to generate source code from templates.
You can easily create your custom generators using known template engines: Groovy (JSP like), Freemarker or Velocity.
See it in action here.
The files:
HelloWorld.generator
|-- templates
|-- HelloWorldTemplate.txt.ftl
|-- templates.ftl
|-- params.ftl
Contents of HelloWorldTemplate.txt.ftl:
Hello ${name}!!!
Contents of params.ftl:
name=World
Contents of templates.ftl:
templates/HelloWorldTemplate.txt.ftl=src/destinationPath/HelloWorld.txt
Installing generators: just create a folder named "generators" at the root of your project, and place your generators there.
Running generators: The plugin adds a “Generate…” option to your project context menu (right-click menu). Run it, choose one of your installed generators, set its parameters, and the plugin will generate the files to the right place.
See it in action here: Quickly cruding with code2code plugin and VRaptor2.
Current version is 0.9.2 beta, tested against Eclipse Ganymede 3.4.2.
You can install it from the Update Site
http://wiki.github.com/srizzo/code2code
http://github.com/srizzo/code2code/issues
http://github.com/srizzo/code2code-example-generators/downloads