是否“/*(非 javadoc)”有很好理解的含义吗?

发布于 2024-10-10 11:38:06 字数 263 浏览 0 评论 0原文

除了向源代码读者指出注释块故意不是 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

我一向站在原地 2024-10-17 11:38:06

根据我能找到的信息,这是为了修复一个错误在旧版本的 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.

看海 2024-10-17 11:38:06

除了评论之外,它没有既定的含义。该格式是通用 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文