Unable to see Java 5 features from Doclet API
The Doclet API was extended in Java 5 for getting information in generics, but I have been unable to get it to work. For example, calling ClassDoc.typeParameters and typeParamTags always returns an empty array.
/**
* @param <X> The X
*/
publicclass Test<X>{
}
And the Doclet is:
import com.sun.javadoc.*;
publicclass TestDocextends Doclet{
publicstaticboolean start(RootDoc root){
for (ClassDoc cd : root.classes()){
System.out.println();
System.out.println(cd);
TypeVariable[] tv = cd.typeParameters();
if (tv.length == 0){
System.out.println("No type parameters");
}else{
for (TypeVariable t : tv){
System.out.println("tv: " + t);
}
}
ParamTag[] pt = cd.typeParamTags();
if (pt.length == 0){
System.out.println("No type parameter tags");
}else{
for (ParamTag t : pt){
System.out.println("pt: " + t);
}
}
}
returntrue;
}
}
For the Test class, it always prints out:
No type parameters
No type parameter tags
I'm running version 1.5.0_05. Is there some magic flag that needs to get passed? I have been unable to see any evidence that the new Java 5 API does anything at all.

