[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[news.eclipse.tools.jdt] How to get annotation information from a java source-file?

Hi everybody,

I am writing a validator for a self-programmed editor. Therefore, I need the annotations from classes and methods. Since those classes are not in the classpath of my validator, I can't use the following:

Class<?> myType = Class.forName("mypackage.MyType");
Annotation[] myAnnotations = myType.getAnnotations();
Method[] myMethods = myType.getMethods();
Annotation[] myAnnotations2 = myMethods[0].getAnnotations();

Do you know if and how I can get this information from org.eclipse.jdt.core.IType or where else can I get it from?

Thanks for your consideration!

Judith