I think you just want to:
javax.lang.model.element.Element
<A extends Annotation> A getAnnotation(Class<A> annotationType)
Returns this annotation of an element for the specified type, if such an annotation is present, otherwise null. Annotations can be either inherited or directly present in this element.
And enter the class explicitly (e.g. name.class).
, Class.forName(variable) name.class . forName, , . instanceof - , , , .