Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » How to get annotation information from a java source-file?
How to get annotation information from a java source-file? [message #301678] Tue, 04 April 2006 05:46 Go to next message
Eclipse UserFriend
Originally posted by: automatic.javalobby.org

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
Re: How to get annotation information from a java source-file? [message #301690 is a reply to message #301678] Tue, 04 April 2006 07:52 Go to previous messageGo to next message
Eclipse UserFriend
I'd ask this question on eclipse.tools.jdt as well, there are more
people there that are likely to know.

Later,
PW
Re: How to get annotation information from a java source-file? [message #301728 is a reply to message #301678] Tue, 04 April 2006 19:29 Go to previous message
Eclipse UserFriend
Originally posted by: wharley.bea.com

"Judith" <automatic@javalobby.org> wrote in message
news:8779864.1144144022580.JavaMail.root@cp1.javalobby.org...
> Hi everybody,
>
> I am writing a validator for a self-programmed editor. Therefore, I need
> the annotations from classes and methods. [..]


Have a look at the APT functionality that is now in Eclipse; it is possible
that you can implement your validator as an annotation processor, using the
com.sun.mirror.apt interfaces.
Previous Topic:Project nature icons
Next Topic:One developer two development sites: How to move the project back and forth?
Goto Forum:
  


Current Time: Wed Jul 23 17:02:11 EDT 2025

Powered by FUDForum. Page generated in 0.04417 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top