Javadoc {@inheritDoc} tag class

LandonSchropp picture LandonSchropp · Jan 29, 2010 · Viewed 75.3k times · Source

I would like to use the {@inheritDoc} class to inherit methods from my abstract class. In the documentation for the abstract class, I refer to the abstract class by name. How can I tag this so when the subclass inherits the documentation from the super class, it replaces the abstract class's name with the subclass's name?

Answer

bguiz picture bguiz · Jan 30, 2010

What you are describing is not supported by the javadoc generation tool.

And I think that there is a good reason for this too:

If your method in the subclass is merely an implementation of an abstract method, then I think it would be correct to leave the abstract class' name in there.

On the flip side, if your method in the subclass is not just a simple implementation, and does something more that is noteworthy (enough to be mentioned in the javadoc), then you should write a new javadoc on the method in the subclass, instead of invoking inheritDoc.