wood burning stoves 2.0*
The moose likes Java in General and the fly likes Processing Custom Annotations Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Processing Custom Annotations" Watch "Processing Custom Annotations" New topic
Author

Processing Custom Annotations

Zak Nixon
Ranch Hand

Joined: Sep 27, 2003
Posts: 126
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

Joined: Feb 18, 2005
Posts: 1006
    
    3
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

Joined: Sep 27, 2003
Posts: 126
Thanks Ryan for your attempt.

Unfourtunately, that will still not work....


Zak
Zak Nixon
Ranch Hand

Joined: Sep 27, 2003
Posts: 126
Actually, after looking at my code,
I was incorrect in other places rather than the code Ryan posted.

It does work, BTW.

Zak
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Processing Custom Annotations
 
Similar Threads
Jboss 5.1 aop not working
Can not find the expected secondary table
ANT : trying not to include jar class files
Annotation Handler in Java
how to inject a resource using custom annotation