[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.tools.jdt] Get the IType for an IAnnotation?

Hello,

I am wondering how to get the IType for a given IAnnotation. That is, if a method is annotated somehow:

@Pure
void getSize() {...}

I'd like the IType associated with @Pure:

public @interface Pure {...}


I am assuming this is possible, because when I ctrl-click on @Pure in the Java IDE, it takes me to the annotation declaration. However, as far as I can tell, the only way to tell what kind of annotation I have is by calling IAnnotation.getElementName(), which returns a string. At that point, I am stuck.


I apologize if this is a strange question. It's probably because I've been working in ITypeBinding/IAnnotationBinding land, where this isn't particularly difficult.

Thanks,
Nels