我应该使用“非Javadoc”吗?评论? [英] Should I use a "non-Javadoc" comment?
问题描述
我实现了自己在界面中定义的方法。但是当我尝试将Javadoc添加到此方法时,Eclipse给了我这样的评论:
I implemented my own method defined in an interface. However when I try to add Javadoc to this method Eclipse gave me a comment like this:
/* (non-Javadoc)
* @see javax.servlet.ServletContextListener#contextInitialized(javax.servlet.ServletContextEvent)
*/
实际上,我真的需要为这个方法添加一些注释。我该怎么办?
Actually, I really need to add some comment to this method. What should I do?
推荐答案
这里添加非javadoc注释的想法是在生成的javadoc中添加注释继承的方法将被复制,这可能就足够了 - 并且比你有一个空的 / ** * /
评论更好。同时,您可以使用源代码中的链接来查找方法。正如Ken所说,你可以随时改变它。
The idea of adding a non-javadoc comment here is that in the generated javadoc the comment from the inherited method will be copied, which might be enough - and better than if you had an empty /** */
comment. At the same time, you can use the link in the source code to look up the method. And as said by Ken, you can always change it.
如果你想要包含界面的文档,请使用 {@ inheritDoc}
在您的评论中。
If you want to include the interface's documentation, use {@inheritDoc}
in your comment.
这篇关于我应该使用“非Javadoc”吗?评论?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!