I would like to write my Javadoc comments once for each field and access the output of the Javadoc field in the getter and setter methods.
I know there is a tag {@inheritDoc}for linking to the documentation of the parent method, but I want to include the documentation in the field, which, of course, is not the parent method.
{@inheritDoc}
Is it possible to "not repeat myself" with Javadoc?
Besides @see, you don’t know how to do it.
@see
, /. , .
( , - / .., Java , - Java. , , IDE , , , . , ..)
(, Spoon, , , , 1.5.)
javadoc {@link MyObject#get..()} .
{@link MyObject#get..()}
API/, ( ) , .
This type of template can be avoided using Project Lombok . Just write down the field variable, even if it is private, and let the Lombok annotations generate properly documented getters and setters.
private
For me, this advantage is in itself worth the cost .