I am playing with the Doclets, and I am running into the next problem. I want to get the attributes from a class, and I thought the parameter method would help. My code looks like the next one(I am doing that for the return type of a method):
ClassDoc retType = pMethod.returnType().asClassDoc();
if(retType == null) {
System.out.println("No returnType for method " + pMethod.name());
return false;
} else {
System.out.println("returnType for method "
+ pMethod.name() + " is from type " + pMethod.returnType().typeName());
}
FieldDoc[] fields = retType.fields();
System.out.println("fields length for type " +
retType.name() + " is " + fields.length);
What I am getting is
returnType for method myMethod is from type MyMethodResponse
fields length for type MyMethodResponse is 0
Maybe I am missing something. Would not the ClassDoc.fields() method bring me all the list of attributes? Is there any way to do that? Thank you very much.