使用JavaDoc,我该如何引用类中final static字段的值?
在这个例子中,我想要用字段STATIC_FIELD
的值替换???
。
/**
* This is a simple class with only one static field with the value ???.
*/
public class Simple {
/**
* We can reference the value with {@value} here,
* but how do we reference it in the class JavaDoc?
*/
public static final String STATIC_FIELD = "simple static field";
}
{@value com.package.other.Clazz#STATIC_FIELD}
。 - Sean{@link ...}
提供了指向指定字段Javadoc的链接,但该Javadoc本身并不提供值。{@value ...}
提供实际的值,这也是所要求的内容。'非原始类型'与此完全无关。例如,在Javadoc工具文档中使用java.lang.String
的{@value ...}
示例。 - user207421