Process Jdk1.5 Annotations

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Process Jdk1.5 Annotations

Smitha R
Hi,
I am using Eclipse3.1.0.
In my plugin, I need to find all the annotations in a java file. I am
trying to use reflection to load the class file which is getting
edited and from the Class, we can get all annotations. (Ofcourse for
this the file need to be saved and compiled before invoking the plugin
). But when the plugin runs, I am not able to load the class for the
current file. Is there any way to add classpath for the plugin to the
currently active project?

As an alternative, I tried using ICompilationUnit of
org.eclipse.jdt.core. Here I am able to get method names, package
names, imports etc, but no annotations. Will the future versions of
jdt.core support getting all Annotations?

Regards,
Smitha
_______________________________________________
jdt-dev mailing list
[hidden email]
https://dev.eclipse.org/mailman/listinfo/jdt-dev
Reply | Threaded
Open this post in threaded view
|

Re: Process Jdk1.5 Annotations

Olivier Thomann
You can use a org.eclipse.jdt.core.dom.ASTParser. See the method
setSource(ICompilationUnit).
Then you can walk the tree to retrieve all annotations.

Note that such questions should be asked on the Eclipse newsgroups.

Olivier
_______________________________________________
jdt-dev mailing list
[hidden email]
https://dev.eclipse.org/mailman/listinfo/jdt-dev
Reply | Threaded
Open this post in threaded view
|

Sticky Hover?

Spiros Xanthos
Hello,
I am building an editor in eclipse and I want to create a sticky hover,
like those of the JDT that become scrollable by clicking F2. How can I
do this?

--Spiros
_______________________________________________
jdt-dev mailing list
[hidden email]
https://dev.eclipse.org/mailman/listinfo/jdt-dev
Reply | Threaded
Open this post in threaded view
|

RE: Process Jdk1.5 Annotations

Tim Wagner
In reply to this post by Smitha R
If you don't mind working on a post-3.1 branch, BEA has provided
apt/mirror processing functionality for annotations. I've cc'ed Jess
Garms, dev lead, who can provide you with more information if you're
interested.

-----Original Message-----
From: [hidden email] [mailto:[hidden email]]
On Behalf Of Smitha R
Sent: Thursday, June 23, 2005 4:53 AM
To: [hidden email]
Subject: [jdt-dev] Process Jdk1.5 Annotations

Hi,
I am using Eclipse3.1.0.
In my plugin, I need to find all the annotations in a java file. I am
trying to use reflection to load the class file which is getting
edited and from the Class, we can get all annotations. (Ofcourse for
this the file need to be saved and compiled before invoking the plugin
). But when the plugin runs, I am not able to load the class for the
current file. Is there any way to add classpath for the plugin to the
currently active project?

As an alternative, I tried using ICompilationUnit of
org.eclipse.jdt.core. Here I am able to get method names, package
names, imports etc, but no annotations. Will the future versions of
jdt.core support getting all Annotations?

Regards,
Smitha
_______________________________________________
jdt-dev mailing list
[hidden email]
https://dev.eclipse.org/mailman/listinfo/jdt-dev


_______________________________________________
jdt-dev mailing list
[hidden email]
https://dev.eclipse.org/mailman/listinfo/jdt-dev