tags:

views:

8

answers:

0

Hi, I have the following problem in my AnnotationProcessor (Java 1.6) when checking if one Type is a subtype of another:

public interface IGeneric { public boolean isGeneric(T value); } and the implementing type

public class Test implements IGeneric { @Override public boolean isGeneric(final String value) { ... } }

In my annotation processor I want to check if Test is a subtype of IGeneric, so I call

processingEnv.getTypeUtils().isSubtype(myTestElement.asType(), myIGenericElement.asType()) which returns FALSE in this case. Question: this does not seem to work due to the generic type IGeneric, but how can I check that Test implements IGeneric? I do not want to iterate the type hierarchy all the time but use a function to check the relation.

Thanks for help