Re: [aspectwerkz-user] args() for variable number of parameters?
Alexandre Vasseur <[email protected]> Thu, 2 Feb 2006 11:11:39 +0100
| Newsgroups | gmane.comp.java.aspectwerkz.user |
|---|---|
| Message-ID | <[email protected]> |
You can write: execution(* Test.*(..)) AND args(s,..) methodCheck(JoinPoint j,String s) to access the other arguments not bound in the pointcut, you can then use the JoinPoint API On 2/2/06, Balakrishnan <[email protected]> wrote: > Hi, > > Is it possible to write a pointcut with "args()" that > match variable number of arguments? My problem is that > in my JoinPoint class, I want the value of these > parameters. > > ---- > > For ex: > > public class Test > { > public String method1(String s) {} > public String method2(String s,String s1) {} > public String method3(String s,int i) {} > } > > For this class, currently my pointcut is like > > execution(* Test.*(..)) AND args(s,..) > > and advice is > > methodCheck(JoinPoint j,String s,Object[] otherArgs) > > ---- > > Ofcourse, this is giving error and I couldn't write a > pointcut/joinpoint combination that allows me to > select these methods and get the parameter values. > > Regards, > Balakrishnan. > > > > > __________________________________________________________ > Yahoo! India Matrimony: Find your partner now. Go to http://yahoo.shaadi.com >