Getting the Java 5 annotations from an IClassFile [message #198140] |
Wed, 09 March 2005 21:48 ![Go to next message Go to next message](theme/Solstice/images/down.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
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 22:04 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) ![Go to next message Go to next message](theme/Solstice/images/down.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
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 17:09 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) ![Go to next message Go to next message](theme/Solstice/images/down.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
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 15:08 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
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
|
|
|
Powered by
FUDForum. Page generated in 0.03466 seconds