在一个内部类使用@value不变的Javadoc显示值 [英] Javadoc displaying value on an inner class constant using @value

查看:1607
本文介绍了在一个内部类使用@value不变的Javadoc显示值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个声明了一个恒定的一个内部类,并想显示其在使用@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;
  }
}

任何想法如何在类的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#领域}

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

这篇关于在一个内部类使用@value不变的Javadoc显示值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆