Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » Getting the Java 5 annotations from an IClassFile
Getting the Java 5 annotations from an IClassFile [message #198140] Wed, 09 March 2005 16:48 Go to next message
Eclipse UserFriend
Originally posted by: changed99.hotmail.com

Is there a way to do this in Eclipse?

I see an API to parse the class file to get the raw annotations, but
that requires that I get the bytes.

How would I get access to the bytes with an IClassFile?

Alternatively, is there a better way to get access to the annotations
for an IType?

I got the impression that there wasn't, given an earlier message about
having to parse the AST to get the annotations from an IField or IMethod.

edwin
Re: Getting the Java 5 annotations from an IClassFile [message #198148 is a reply to message #198140] Wed, 09 March 2005 17:04 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: olivier_thomannNOSPAM.ca.ibm.com

Edwin Chan a écrit :
> I got the impression that there wasn't, given an earlier message about
> having to parse the AST to get the annotations from an IField or IMethod.
What do you need to do with these annotations?
You can look at the org.eclipse.jdt.core.util.IClassFileReader class. It
gives you a representation of the class file contents.
--
Olivier
Re: Getting the Java 5 annotations from an IClassFile [message #198276 is a reply to message #198148] Thu, 10 March 2005 12:09 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: changed99.hotmail.com

> What do you need to do with these annotations?
> You can look at the org.eclipse.jdt.core.util.IClassFileReader class. It
> gives you a representation of the class file contents.

Actually, a more useful reference is to use
org.eclipse.jdt.core.ToolFactory.createDefaultClassFileReade r().

edwin
Re: Getting the Java 5 annotations from an IClassFile [message #198415 is a reply to message #198276] Fri, 11 March 2005 10:08 Go to previous message
Eclipse UserFriend
Originally posted by: changed99.hotmail.com

> Actually, a more useful reference is to use
> org.eclipse.jdt.core.ToolFactory.createDefaultClassFileReade r().

Still, IClassFileReader is a pretty low level interface.
Is there anything higher level than that to look at the annotations?
(I'd like to use them in a tool we're building to process the source
and class files they use)

edwin
Previous Topic:turn off a warning
Next Topic:Launching Ant-view builds with keyboard shotcut
Goto Forum:
  


Current Time: Thu May 08 12:11:35 EDT 2025

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

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

Back to the top