• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Processing Custom Annotations

 
Zak Nixon
Ranch Hand
Posts: 126
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to analyze my code to see if
custom annotations are present.
I am currently reading *.class files from a jar file,
and then trying to see if the annotation is present.

I have been running into some problems though.

1. When I am trying to do the following:



But if I do the following (the only way I know to do it
by dynamically reading it from a jar file):

Using the above code, i can not find the annotations.

Any help would be appreciated ?

Zak
 
Ryan McGuire
Ranch Hand
Posts: 1048
4
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Disclaimer: I DON'T KNOW. But since this questions has been here for over half a day without and answer, I'll take a poke at it.

Have you tried using forName() to load the class.


That should find the class anywhere on your classpath, even in a JAR file.

Ryan
 
Zak Nixon
Ranch Hand
Posts: 126
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Ryan for your attempt.

Unfourtunately, that will still not work....


Zak
 
Zak Nixon
Ranch Hand
Posts: 126
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually, after looking at my code,
I was incorrect in other places rather than the code Ryan posted.

It does work, BTW.

Zak
 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic