Getting the qualified class name of generic type with Java 6 annotation processor
I am developing a small code generator using JDK 6's Annotation Processing API and am stuck trying to get the actual generic type of a field in the class. To be clearer, let's say I have a class like this: @MyAnnotation public class User { private String id; private String username; private String password; private Set<Role> roles = new HashSet<Role>(); private UserProfile profile; } and here is my annotation processor class: @SupportedAnnotationTypes({ "xxx.MyAnnotation" }) @SupportedSourceVersion(SourceVersion.RELEASE_6) public class MongoDocumentAnnotationProcessor extends AbstractProcessor