• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Processing Custom Annotations

 
Ranch Hand
Posts: 126
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Bartender
Posts: 1205
22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Ryan for your attempt.

Unfourtunately, that will still not work....


Zak
 
Zak Nixon
Ranch Hand
Posts: 126
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
reply
    Bookmark Topic Watch Topic
  • New Topic