JavaDoc: reduce redundancy for repeated descriptions of methods within the same class

For example, I have two methods: public Tree<T> addChild(final T data) {} and public Tree<T> addChild(final T... data) {} , their JavaDocs are identical. How to put /** method description */ in one of them and use the tag to link to another JavaDoc to the previous one?

Just like in concept:

 /** * method description */ public Tree<T> addChild(final T data) { ... } /** * @theTag #addChild(Object) */ public Tree<T> addChild(final T... data) { ... } 

If I remember it correctly, I accidentally stumbled upon a tag that imports a description of the entire API-based Java-API method. Therefore, it should be possible.

What is @theTag ? Many thanks!

+4
source share
1 answer

What about the @see tag? This does not quite import, but rather puts a link:

 /** * action 1 description */ public void action1(){} /** * @see MyClass#action1 */ public void action2(){} 
+2
source

Source: https://habr.com/ru/post/1502105/


All Articles