开发者

Autogenerate function comments in Eclipse

How to autogenerate xml based function header comments (@param etc) in Eclipse. Is there an equivalent of "///" shortcut in Visua开发者_如何学JAVAl Studio.


In the line just before the method definition, type /** and hit enter.

In the IDE, type /** just before the method and hit enter. Eclipse will autogenerate the Javadoc tags and the end */

type /** here and his enter, eclipse will generate the javadoc tags and the end */
public void setName(String name)
{
   ...
}


You can do this by clicking ALT+Shift+J inside the method/class. | It's not XML Based though, but you can generate JavaDoc by clicking Project->Generate JavaDoc... in the menubar.


You can specify what is autogenerated in Eclipse by going to Window->Preferences

Under, Java -> Code Style -> Code Templates; is the list of what comments get put where. You can google for the syntax of how to insert the different param names and other constants so that you can generate whatever comment you wish, be it Javadoc or other.

As Nivas said, typing /** then hitting enter will auto insert a the comment.


http://jautodoc.sourceforge.net/

JAutodoc is 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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜