Check My Vars

Compatible with IntelliJ IDEA
Oct 30, 2008
2 862
Generate code according to Annotation

Configure template to generate code depending on annotation and type of parameter.
For example, code like:
public void minMaxNumber(@MinMax(min = 1, max = 5)int nb) {
}

Can generate this:
public void minMaxNumber(@MinMax(min = 1, max = 5)int nb) {
if (nb < 1 || nb > 5) {
throw new IllegalArgumentException("nb value must be between 1 and 5 (inclusive)");
}
}


Action is available under "Generate..." menu.
On first use, the plugin will ask you to generate a sample if it found nothing to generate.


Future release will include a support for javadoc tag as an alternative to Annotation, so JDK 1.4 or earlier users can use this plugin

Download plugin