How can a method's Javadoc be copied into other method's Javadoc?

java.is.for.desktop picture java.is.for.desktop · Sep 1, 2010 · Viewed 12.8k times · Source

I know that there is @inheritDoc, but it's only for methods which override others.

I have several classes with many delegate methods (which do not override others).

Can their Javadoc be "inherited" (more exactly: copied)?

/** here I need the copy of wrappedMethod's Javadoc */
public void delegateMethod(Object param){
  innerSomething.wrappedMethod(param);
}

Answer

Danny Thomas picture Danny Thomas · Sep 1, 2010

A @link or @see tag would be appropriate here. If you're wrapping the method, it must provide distinctive behavior which makes it unsuitable for overloading or otherwise.