为 Eclipse 中的现有代码生成 JavaDoc 注释
我知道在创建类、接口等时可以在向导屏幕中生成它们的注释,但我还没有找到为现有文件生成 javadoc 注释的选项。是否可以?
谢谢。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
命令是“
添加 Javadoc 注释
”或“生成元素注释
”(Alt+Shift+J),并且它取决于当前选择的one元素。它不能应用于所有文件。因此,如果您通过项目资源管理器视图选择所有类,您将无法从那里生成所有缺少的注释。
但从 Project Explorer 来看,正如 Vitalii Fedorenko 在评论中提到的那样,它有效(刚刚测试过):
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):
如果您喜欢双手放在键盘上,那么在方法之前的行中键入
/**
并按 Enter 也可以:-->
If you like to keep both hands on keyboard, then typing
/**
on the line before a method and pressing enter works too:-->
这个 https://stackoverflow.com/a/8223484/830945 为这个问题提供了一个很好的解决方案。
我自己已经测试过,它与 eclipse 配合得很好。
您只需右键单击项目,然后选择所需的选项。可以从 http://jautodoc.sourceforge.net/index.html 下载
This https://stackoverflow.com/a/8223484/830945 provides a very solution for this problem.
I myself have tested it and it works very well with eclipse.
You just need to right click project, then choose required option. can be downloaded from http://jautodoc.sourceforge.net/index.html