This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Aspect Oriented Programming and the fly likes AspectJ Pointcut expression to intercept enum methods Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Frameworks » Aspect Oriented Programming
Reply Bookmark "AspectJ Pointcut expression to intercept enum methods" Watch "AspectJ Pointcut expression to intercept enum methods" New topic
Author

AspectJ Pointcut expression to intercept enum methods

Alon Cohen
Greenhorn

Joined: Dec 02, 2010
Posts: 3
Using AspectJ, I want to intercept every toString() invocation on an enum construct.

For example, Assuming GridVisible is an enum that does NOT implement toString():

GridVisible gv = GridVisible.FE;
return gv.toString();


I need an expression that intercepts the call to toString(). I figured that the correct expression would look something like:



That doesn't work. I also tried many kinds of combination, mainly using the calling(), $instanceof and $implementing expressions, but to no avail.

Thanks
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: AspectJ Pointcut expression to intercept enum methods
 
Similar Threads
How to write the pointcut for a method in the inter-interface
Any good examples of using @Before instead of setup
want an advisor for many pointcut
Spring Transaction by AOP
Spring/AspectJ vs Spring AOP