Find type parameter of method return type in Java 6 annotation processor
问题 I'm writing a tool that uses the annotation processor to generate source code depending on the return type of methods of an annotated class. The return type is always some subtype (interface or class) of an interface A that defines a type variable T . interface A<T>{T m();}; I would like to find the type parameter for the method m() return value type variable T . The return type is represented by the annotation processor as a javax.lang.model.type.TypeMirror instance. The simplest case is to