Active code generator using Free marker - java
Active code generation explaination:
In contrast, active code generators are designed to maintain a link with the code that is generated over the long term by allowing the generator to be run multiple times over the same code. The key point to keep in mind about active code generators is that the template is the source code. Suppose you're generating 500 class files from a single template. With an active code generator, if you find a bug in the architecture of those classes (say, you've made a mistake in the way that you're handling object persistence), it's not a huge problem. You just fix the one template and regenerate the 500 classes. This obviously saves you an incredible amount of time over fixing the same bug over and over again in 500 separate class files.