Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Javadoc inheriting parent constructors documentation

Consider that I am extending a class such as:

public class MyComboBox<T> extends JComboBox<T> {

    public MyComboBox() {
        super();
    }

    public MyComboBox(ComboBoxModel<T> model ) {
        super(model);
    }

}

Re-defining the parent's constructors (which are fitting for my new class, of course) is annoying enough, but to also copy each constructors documentation is even worse. Not to mention that it's bad for further inheritance, since I now have to update the documentation multiple times.

Obviously, {@inheritDoc} won't work as I am not overriding anything. This is, however, the behavior I'm looking for. Is there any way to achieve this?

How to inherit the parent constructors documentation?

like image 657
Zar Avatar asked Jan 18 '13 15:01

Zar


1 Answers

Use the @see tag and put the class & member name. To see how that shows up look at JDocs where you can jump from javadoc to source code.

The exact synatax is:

 @see com.x.y.z.ClassName#methodName()
like image 146
Καrτhικ Avatar answered Oct 09 '22 01:10

Καrτhικ