Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Annotations question

 
Matthew Givney
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic