Javadoc displaying value on an inner class constant using @value(Javadoc 使用 @value 在内部类常量上显示值)
问题描述
我有一个内部类,它声明一个常量,并希望使用 @value 注释在封闭的顶级类的 Javadoc 中显示它的值.例如:
I have an inner class which declares a constant and want to display its value in Javadoc of the enclosing top-level class using the @value annotation. For example:
/**
* {@value #FOO_CONS} // this displays well
* {@value #BAR_CONS} // this does not work (checked in the latest Eclipse)
* {@value Bar#BAR_CONS} // this does not work, either
*/
public Foo {
public static final int FOO_CONS = 1;
static class Bar {
public static final int BAR_CONS = 42;
}
}
任何想法如何在 Foo
类(或任何其他类,一般来说)的 Javadoc 中显示 BAR_CONS 的值?
Any ideas how to display the value of BAR_CONS in Javadoc of the Foo
class (or any other class, in general)?
推荐答案
另一个包中定义的常量的Javadoc格式应该是:
{@value package.class#field}
Javadoc format for constant defined in another package should be:
{@value package.class#field}
但是,它可能无法呈现是一个已知问题:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=342194
However, it potentially not rendering is a known issue:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=342194
这篇关于Javadoc 使用 @value 在内部类常量上显示值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:Javadoc 使用 @value 在内部类常量上显示值


基础教程推荐
- 降序排序:Java Map 2022-01-01
- Java Keytool 导入证书后出错,"keytool error: java.io.FileNotFoundException &拒绝访问" 2022-01-01
- 如何使用 Java 创建 X509 证书? 2022-01-01
- 设置 bean 时出现 Nullpointerexception 2022-01-01
- FirebaseListAdapter 不推送聊天应用程序的单个项目 - Firebase-Ui 3.1 2022-01-01
- 在 Libgdx 中处理屏幕的正确方法 2022-01-01
- “未找到匹配项"使用 matcher 的 group 方法时 2022-01-01
- Java:带有char数组的println给出乱码 2022-01-01
- 无法使用修饰符“public final"访问 java.util.Ha 2022-01-01
- 减少 JVM 暂停时间 >1 秒使用 UseConcMarkSweepGC 2022-01-01