问题
Possible Duplicate:
Javadoc template generator
Is there a way to generate Javadoc comments in Eclipse? If so, what is it?
回答1:
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.
回答2:
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;
}
回答3:
JAutoDoc:
an Eclipse Plugin for automatically adding Javadoc and file headers to your source code. It optionally generates initial comments from element name by using Velocity templates for Javadoc and file headers...
回答4:
You mean menu Project -> Generate Javadoc ?
回答5:
At a place where you want javadoc, type in /**
<NEWLINE> and it will create the template.
来源:https://stackoverflow.com/questions/1777175/how-can-i-generate-javadoc-comments-in-eclipse