Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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); } 
like image 891
java.is.for.desktop Avatar asked Sep 01 '10 12:09

java.is.for.desktop


People also ask

How do you reference another method in Javadoc?

Javadoc provides the @link inline tag for referencing the members in the Java classes. We can think of the @link tag as similar to the anchor tag in HTML, which is used to link one page to another via hyperlinks. Similar to the anchor tag, the path_to_member is the destination, and the label is the display text.

How do I export a Javadoc?

In Eclipse, go to File > Export. Expand Java and select Javadoc. Then click Next. Select your project and package.

How do I add a note in Javadoc?

Generally, the first sentence of Javadoc should give a brief description of the class/method/field. Then the full description should follow. And if you want to include any notes, a specialized paragraph with a "Note:" prepended should suffice. Generally if you open (xml-)tags you should close them somewhere.

What information is needed in a method's Javadoc?

For example, most Javadoc comments for methods include " @param " and " @return " tags when applicable, to describe the method's parameters and return value. The " @param " tag should be followed by the parameter's name, and then a description of that parameter.


1 Answers

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.

like image 186
Danny Thomas Avatar answered Sep 20 '22 14:09

Danny Thomas