Re: [aspectwerkz-user] args() for variable number of parameters?

Balakrishnan <[email protected]> Thu, 2 Feb 2006 11:54:39 +0000 (GMT)
Newsgroups gmane.comp.java.aspectwerkz.user
Message-ID <[email protected]>
Oh, thanks.

Can I do something like this then?

        MethodRtti rtti =
(MethodRtti)joinPoint.getRtti();
        rtti.getParameterValues();

Regards,
Balakrishnan.

--- Alexandre Vasseur <[email protected]> wrote:

> 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
> >
> 



		
__________________________________________________________ 
Yahoo! India Matrimony: Find your partner now. Go to http://yahoo.shaadi.com