javadoc: @value to reference field in other class

早过忘川 提交于 2020-01-03 16:41:46

问题


/**  {@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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!