Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » AspectJ » multiple formal parameters?
multiple formal parameters? [message #578460] Fri, 16 April 2004 10:16
Michael Moser is currently offline Michael MoserFriend
Messages: 914
Registered: July 2009
Senior Member
I am frustrated - I don't get it!

I want to specify an advice that has TWO parameters and I need access
to BOTH parameters in the advice.

I was able to phrase that as an "anonymous" pointcut (I think that's
the name for something like this):
....
before(IEvent evt, boolean flag): target(evt) && call(*
IEvent.setHandled(boolean)) && args(flag) {
...
}
....

But now I would like to specify this as a NAMED pointcut (1st to make
this more readable and 2nd to reuse the pointcut in more than one
advice):

I defined the pointcut:
....
pointcut eventSetHandled(IEvent evt, boolean flag): target(evt) &&
call(* IEvent.setHandled(boolean)) && args(flag);

And now I want to specify the advice. But how do I phrase this? I
tried:

before(IEvent evt, boolean flag): eventSetHandled(IEvent, boolean)
{ ... }
before(IEvent evt, boolean flag): eventSetHandled(IEvent evt,
boolean flag) { ... }
before(IEvent evt, boolean flag): eventSetHandled(evt, flag) {
.... }
???

None of the above work, i.e. all variants just yield compile errors!
How do I phrase this? What do I need to specify to get hold of more
than a single parameter of a named pointcut??? Or is this not possible
at all?

Alas, all the examples given in the AspectJ manual only show a single
parameter...

Michael
Previous Topic:1.1.7 on 3.0M8 causes OutOfMemoryError
Next Topic:multiple formal parameters?
Goto Forum:
  


Current Time: Tue Apr 30 02:53:35 GMT 2024

Powered by FUDForum. Page generated in 0.03941 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top