Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
296 views
in Technique[技术] by (71.8m points)

java - Javadoc displaying value on an inner class constant using @value

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;
  }
}

Any ideas how to display the value of BAR_CONS in Javadoc of the Foo class (or any other class, in general)?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Javadoc format for constant defined in another package should be:
{@value package.class#field}

However, it potentially not rendering is a known issue:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=342194


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...