Eclipse has a feature to generate a constructor for a class from fields of that class. However, the option to automatically add Javadoc is insufficient, as it would be easily possible to insert the comment of the fields for the parameters. I would like to automate this, but don't know how.
Example:
I have this class:
class Animal {
/**
* the number of legs of the animal. This influences many features of the animal, such as its ability to stand, to run, and to not fall over and starve to death. Must not be negative unless the animal is marked as Lovecraftian.
*/
int numberOfLegs;
}
When I use the shortcut of Eclipse to generate a constructor from fields, it creates this:
/**
* @param numberOfLegs
*/
public Animal(int numberOfLegs) {
this.numberOfLegs = numberOfLegs;
}
This is because the Javadoc that is generated automatically is defined as this:
/**
* ${tags}
*/
What I would like to have instead is this:
/**
* @param numberOfLegs the number of legs of the animal. This influences many features of the animal, such as its ability to stand, to run, and to not fall over and starve to death. Must not be negative unless the animal is marked as Lovecraftian.
*/
or alternatively this:
/**
* @param numberOfLegs {@link numberOfLegs}
*/
Is there a way to automate this with eclipse natively? If not, is there a plugin that can do it?