How Can I Generate Javadoc Comments in Eclipse? [Duplicate]
Is There a Way to Generate Javadoc Comments in Eclipse? If So, What Is It? 2 5 Answers for Me the /** or Shift-Alt-J (Or ⌘-⌥-J on a Mac) Approach Works Best. I...
Is there a way to generate Javadoc comments in Eclipse? If so, what is it?
For me the /**<NEWLINE> or Shift-Alt-J (or ⌘-⌥-J on a Mac) approach works best.
I dislike seeing Javadoc comments in source code that have been auto-generated and have not been updated with real content. As far as I am concerned, such javadocs are nothing more than a waste of screen space.
IMO, it is much much better to generate the Javadoc comment skeletons one by one as you are about to fill in the details.
Shift-Alt-J is a useful keyboard shortcut in Eclipse for creating Javadoc comment templates.
Invoking the shortcut on a class, method or field declaration will create a Javadoc template:
public int doAction(int i) {
return i;
}
Pressing Shift-Alt-J on the method declaration gives:
/**
* @param i
* @return
*/
public int doAction(int i) {
return i;
}
You mean menu Project -> Generate Javadoc ?
At a place where you want javadoc, type in /**<NEWLINE> and it will create the template.