Is it possible to auto-generate Javadoc comments for each method in one class in Eclipse (Indigo)?
是否可以在Eclipse(Indigo)的一个类中为每个方法自动生成Javadoc注释?
4 个解决方案
#1
44
There may be a better approach, but if you expand the class in Package Explorer, select the methods you would to document, then right-click and select "Source -> Generate Element Comment" that will add comments for all the selected methods.
可能有更好的方法,但是如果在Package Explorer中展开类,请选择要记录的方法,然后右键单击并选择“Source - > Generate Element Comment”,它将为所有选定的方法添加注释。
#2
17
The other choice might be to double click on the name of the method, then ALT+Shift+J shortcut.
另一种选择可能是双击方法的名称,然后双击ALT + Shift + J快捷键。
#3
8
There also exist external tools for javadoc generation, for example JAutodoc eclipse plugin. It is possible to customize it's templates to suit your expectation.
还存在用于生成javadoc的外部工具,例如JAutodoc eclipse插件。可以自定义它的模板以满足您的期望。
#4
5
In Eclipse you have possiblity to create java doc template, and then just what need to do is type java-dock block /**
above the element you want to document.
在Eclipse中,您可以创建Java doc模板,然后只需要在要记录的元素上方键入java-dock block / **。
In case when the code is generate, the templates also generate the java-doc.
如果生成代码,模板也会生成java-doc。
All this and even more you will be able to configure in Window -> Preferences, Java -> Code Style -> Code Templates -> Comments
所有这些甚至更多你将能够在窗口 - >首选项,Java - >代码样式 - >代码模板 - >注释中进行配置
#1
44
There may be a better approach, but if you expand the class in Package Explorer, select the methods you would to document, then right-click and select "Source -> Generate Element Comment" that will add comments for all the selected methods.
可能有更好的方法,但是如果在Package Explorer中展开类,请选择要记录的方法,然后右键单击并选择“Source - > Generate Element Comment”,它将为所有选定的方法添加注释。
#2
17
The other choice might be to double click on the name of the method, then ALT+Shift+J shortcut.
另一种选择可能是双击方法的名称,然后双击ALT + Shift + J快捷键。
#3
8
There also exist external tools for javadoc generation, for example JAutodoc eclipse plugin. It is possible to customize it's templates to suit your expectation.
还存在用于生成javadoc的外部工具,例如JAutodoc eclipse插件。可以自定义它的模板以满足您的期望。
#4
5
In Eclipse you have possiblity to create java doc template, and then just what need to do is type java-dock block /**
above the element you want to document.
在Eclipse中,您可以创建Java doc模板,然后只需要在要记录的元素上方键入java-dock block / **。
In case when the code is generate, the templates also generate the java-doc.
如果生成代码,模板也会生成java-doc。
All this and even more you will be able to configure in Window -> Preferences, Java -> Code Style -> Code Templates -> Comments
所有这些甚至更多你将能够在窗口 - >首选项,Java - >代码样式 - >代码模板 - >注释中进行配置