Javadoc seems to only process @value
tags on classes declaring the referenced fields and only references without the classname.
Example:
I have the classes
/** {@value #F} */
public class A {
public static final String F = "field";
}
and
/** {@value A#F} */
public class B {}
The jdk 1.7 javadoc tool processes the @value
tag on A
but for B
I get the following warning:
warning - A#F (referenced by @value tag) is an unknown reference.
This waring also occures when I try to reference the field in the javadoc of A
with A#F
. When I use a @link
tag instead everything works as expected.
I could not find any documentation mentioning that the @value
tag may only reference Fields declared in the class the javadoc is on.
Is this a bug or is there another way to get the @value
tag to display the value?
Providing whole package name with referenced class solves my problem: Assuming class A is defined in package com.example, this works for me:
/**
* {@value com.example.A#F}
*/
public class B {}
Hope it helps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With