I\'m working with on a Java annotations processor. My annotation, @foo
is used to mark field variables that can be read to a file or from a file during runtime. How
Instead of checking the direct supertypes, you should use Types.isAssignable to check if Serializable
is one of the supertypes of the TypeMirror
:
TypeMirror serializable = elementUtil.getTypeElement("java.io.Serializable").asType();
boolean isSerializable = typeUtil.isAssignable(tm, serializable);