[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] Can I add in my aspect file if else conditions before pointcut's or declare

That's a good one :-) I *love* that syntax! Unfortunately that's not
possible in AJ.

You cannot define a pointcut within a body of code. Rather use
something like this:

aspect A {
    boolean isAdd = true
    pointcut aspectCheckAccess():execution(public * *(..)) && if(isAdd);
    ...
}

Eric

On 04/12/2007, Meir Yanovich <meiry@xxxxxxxxxxxx> wrote:
> Hello all
> Well i can't compile the aspect files if I trying to add something like
>
> Boolean isAdd = true
>
> If(isAdd){
> pointcut aspectCheckAccess():execution(public * *(..));
> }
>
> Can I do something equivalent in the aspectJ syntax?
>
> Thanks
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/aspectj-users
>


-- 
Eric Bodden
Sable Research Group
McGill University, Montréal, Canada