是否“/*(非 javadoc)”有很好理解的含义吗?
除了向源代码读者指出注释块故意不是 Javadoc 注释之外,/* (non-javadoc)
是否还有其他含义?最近我看到很多类似这样的代码:
/*
* (non-javadoc)
*
* This method converts widgets to gizmos
*/
public Foo bar() {
...
这是某种既定的约定吗?如果是这样,它是什么意思(超出明显的字面意义)以及何时使用?
Does /* (non-javadoc)
have a meaning, beyond pointing out to the reader of source code that a comment block is intentionally not a Javadoc comment? Lately I've seen a lot of code that looks like this:
/*
* (non-javadoc)
*
* This method converts widgets to gizmos
*/
public Foo bar() {
...
Is this an established convention of some kind? If so, what does it mean (beyond the obvious literal meaning) and when is it used?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
根据我能找到的信息,这是为了修复一个错误在旧版本的 JavaDoc 工具(或者更可能是旧版本的 Eclipse 处理 JavaDoc 注释)中,不会显示覆盖父类方法的方法的正确文档。
正如 Konstantin 所指出的,Eclipse 的覆盖模板包含此文本。
According to the info I could find, this was to fix a bug in older versions of the JavaDoc tool (or more likely older version of Eclipse's processing of JavaDoc comments) that would not display the correct documentation for a method that overrides the method of a parent class.
As noted by Konstantin, Eclipse's override template includes this text.
除了评论之外,它没有既定的含义。该格式是通用 Eclipse 代码格式模板的结果,这解释了它的通用性。
It doesn't have an established meaning besides being a comment. The formatting is result of common Eclipse code formatting templates, which explains its commonality.