I know it's possible to generate comments for classes, interface, etc., in the wizard screen when creating them, but I haven't found an option to generate javadoc comments for an existing file. Is it possible?
Thanks.
I know it's possible to generate comments for classes, interface, etc., in the wizard screen when creating them, but I haven't found an option to generate javadoc comments for an existing file. Is it possible?
Thanks.
The command is "Add Javadoc Comment", or "Generate Element Comment" (Alt+Shift+J), and it is dependent on the one element currently selected.
It cannot be applied to a all file. So if you select the all class through the project explorer view, you won't be able to generate all the missing comments from there.
But from the Project Explorer, as Vitalii Fedorenko mentions in the comments, it works (just tested it):
you should expand a class in the Package Explorer, select all elements and press Alt+Shift+J
If you like to keep both hands on keyboard, then typing /**
on the line before a method and pressing enter works too:
/**[press enter here]
int avg(int a, int b) throws ArithmeticException {
...
}
-->
/**
*
* @param a
* @param b
* @return
* @throws ArithmeticException
*/
int avg(int a, int b) throws ArithmeticException {
...
}