views:

218

answers:

2

Hello,

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?

Thanks,

helixed

+1  A: 

I'm not aware of a way, but you might elaborate on why you want {@inheritDoc} to do this. I may misunderstand, but it seems confusing. You can document how your concrete implementation varies form the parent and use @see to refer to the contract in the abstract class. Note "Automatic Copying of Method Comments" may obviate the need for an explicit {@inheritDoc}.

trashgod
I think I understand. Thanks.
helixed
+2  A: 

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 flips ide, if your method in the subclass is not just a mere implementation, and does something more that is noteworthy (enough to be mentioned in the javadoc), then you should write a new javadoc for the method in the subclass, instead of invoking inheritDoc.

My 2c

bguiz
My reasoning behind this was the reader of my code wouldn't normally look at the abstract class behind the implementation, so I wanted to hide it. However, it appears I can't do this. Thanks anyway.
helixed