问题
/** {@value Constants#KEY_MEAN} blah
* {@value Constants#KEY_STDDEV}
* @return A JSONObject with keys for mean and standardDeviation
*/
When I use this javadoc outside Constants.java but inside the same package, eclipse will just output the plain text, and when generating Javadoc, nothing gets displayed. Is this at all possible?
回答1:
Best start with the obvious. The referenced fields are static
as well as not private
, correct? e.g.,
public static final KEY_MEAN = 1337;
I've been working on figuring out my own similar javadoc questions today and pasting your code into my own, but changing to my class and field names, it worked as expected, "50000 blahaa 50000 Returns: A JSONObject with keys for mean and standardDeviation." This leads me to the question of verifying your field declaration in class Constants
as a reasonable first measure.
来源:https://stackoverflow.com/questions/14199099/javadoc-value-to-reference-field-in-other-class