• 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

Spring aspects annotatted parameter question

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I would like to annotate a parameter in a method and then have my advice successfully read this. However I cannot seem to get the @args to work properly.

Here is an example of the method with the annotated param:


The working advice looks like this:


However instead of args I would like to use the @args value and look for the annotation.
When I attempt to do this, it does not get into the advice:



My goal is to mark a parameter with an annotation so that in my advice i can easily gain access to the object I want to use. Is this possible? It does not seem to be working the way I would assume.

Thanks in advance,
Jeremy
 
Jeremy Odell
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
One more additional interesting find. It seems as though the Joinpoint object does not have any annotation details.
I ran the following test:



I could not get back any annotation information from the joinpoint. I had to use Spring's ClassUtil to get back the info I expected.

I wonder if this is why I could never get a value when using @args?
 
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Try

@args(packagehere.TestParam)

Mark
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic