views:

188

answers:

1

I'm working on a project where we have some custom Taglet classes that are used to modify the Javadocs (such as linking to source code in SVN, adding citations) and so on.One of the things we'd like to do is to be able to get the annotations that are used in the source and manipulate the information from them.

It seems that the Taglet interface does not provide an easy way to access annotations in the Java source code. Does anybody know if this is at all possible?

I'm using JDK 1.5

+1  A: 

If your taglet is called from the standard doclet, you can access its internal state:

import com.sun.tools.doclets.standard.Standard;

ClassDoc currentcd = Standard.htmlDoclet.configuration.currentcd;

I have written a Taglet that uses this technique, but it sure ain't pretty ;-)

mfx