Re: [aspectwerkz-dev] args() pointcut selector and Pointcut as methods.
"Alex" <alex-he/e8N7AIe/[email protected]>
| Newsgroups | gmane.comp.java.aspectwerkz.devel |
|---|---|
| Message-ID | <[email protected]> |
Hi Alexandru mhh, not from my experiments, and from the book "Mastering AspectJ". If you have an Eclipse/AJDT ready a small snip can convince you. Yes, we do support ".." as well. This special pattern will match "zero or more types" and thus is usefull to keep a reference on the first or last parameters only: args(.., prevLast, last) args(first, second, ..) args(first, .., last) It should be used at most once ie args(first, .., middle, .., last) will not be a correct syntax. Alex ----- Original Message ----- From: "the_mindstorm" <[email protected]> To: <[email protected]> Sent: Thursday, August 26, 2004 11:41 PM Subject: Re: [aspectwerkz-dev] args() pointcut selector and Pointcut as methods. > Alex wrote: > > > not at all > > args() can be used > > - to match (and only match) a signature [that is narrowing other pointcuts] > > - to grab parameter values > > - a mix of both > > Isn't this a slightly difference from AspectJ? > > Does the args() pointcut support ..? (e.g. args(s, i, ..)) > > ::the_mindstorm > > > > > Alex > > > > ----- Original Message ----- > > From: "the_mindstorm" <[email protected]> > > To: <[email protected]> > > Sent: Thursday, August 26, 2004 7:51 PM > > Subject: Re: [aspectwerkz-dev] args() pointcut selector and Pointcut as > > methods. > > > > > > > >>Alexandre Vasseur wrote: > >> > >> > >>>Hi > >>> > >>>If anyone is interested in testing new features that will soon be out, > >>>there is support for Pointcut with signature in cvs head - that is > >>>"args()" syntax as introduced by AspectJ. > >>> > >>>/** @Expression execution(* method(..)) && args(s, int) */ > >>> > >>>Pointcut myPC(String s) {return null;} // it is a method ! - could be > >>>"void myPC(String s) {}" instead as well. > >>> > >>>// will match all "method" with "(String, int)" signature. > >>> > >>>/** @Before myPC(s) */ > >>> > >>>Void myBefore(JoinPoint jp, String s) { > >> > >>shouldn't be here the int too? > >> > >>::the_mindstorm > >> > >> > > > > > > > >