Add the following method to com.sun.javadoc.Tag:
public Doc holder();
This method would return the Doc element that holds the tag.
It would be useful to have a holder() method in the Tag interface because it
would give taglets access to the Doc object that holds the tag. This makes
taglets such as {@inheritDoc} easier to write. The {@inheritDoc} taglet
illustrates that it is sometimes necessary to access the holder to perform
the required operations.
Other Doclet API changes will be needed to support generics, which is in
a separate RFE.
Name: rmT116609 Date: 10/31/2002
DESCRIPTION OF THE PROBLEM :
The interface com.sun.javadoc.Tag provides methods to retrieve the name and the text of a custom tag. But there is no method to obtain the class or method where the tag was written. The position does not help very much.
If you look at the implementation of the class com.sun.tools.javadoc.TagImpl you see that in a com.sun.tools.javadoc.DocImpl object is passed to the
constructor.
I suggest to extend the interface com.sun.javadoc.Tag by the method holder() which returns an object of class com.sun.javadoc.Doc.
I did this for an internal project by decompiling the TagImpl class and building a new tools.jar and it helped me a lot.
CUSTOMER WORKAROUND :
Modify the implemenation of TagImpl in the tools.jar (see description for details).
(Review ID: 166297)
======================================================================