我有一个内部类,它声明一个常量,并希望使用 @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 在内部类常量上显示值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!
如何检测 32 位 int 上的整数溢出?How can I detect integer overflow on 32 bits int?(如何检测 32 位 int 上的整数溢出?)
return 语句之前的局部变量,这有关系吗?Local variables before return statements, does it matter?(return 语句之前的局部变量,这有关系吗?)
如何将整数转换为整数?How to convert Integer to int?(如何将整数转换为整数?)
如何在给定范围内创建一个随机打乱数字的 intHow do I create an int array with randomly shuffled numbers in a given range(如何在给定范围内创建一个随机打乱数字的 int 数组)
java的行为不一致==Inconsistent behavior on java#39;s ==(java的行为不一致==)
为什么 Java 能够将 0xff000000 存储为 int?Why is Java able to store 0xff000000 as an int?(为什么 Java 能够将 0xff000000 存储为 int?)