aspose file tools*
The moose likes Java in General and the fly likes Annotations question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Annotations question" Watch "Annotations question" New topic
Author

Annotations question

Matthew Givney
Greenhorn

Joined: Nov 10, 2008
Posts: 1
Greetings,

I was doing some googling to find the answer but the docs on annotation processing with examples are pretty sparse.

My question is, does a method annotation have access to the parameters passed into the method? For example, given the example below, does the Greet annotation have access to the yourName parameter? I know I can do this with AOP, but how about annotations?



Thanks in advance:
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15286
    
    6

No, nor should you want annotations to have such information. That isn't their intended use. What you can do is find all methods marked with @Greet using the Reflection API and then examine the parameters that way.


GenRocket - A Test Data Generation Platform
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Annotations question
 
Similar Threads
Question on EJB based Webservice - Unable to run WSGEN against session bean
Using annotation to put unique value in output
Interfaces question,
does java annotations uses the java refection.
JSF annotations on interface or abstract class