Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] exclude some originating objects?

On 23/07/05, Ted Anagnost <anagnost@xxxxxxxxxxx> wrote:
>  
> Is it possible to define a pointcut such that it picks out calls to methods
> of one class (A) unless those calls are made from some class (B)? 
>   

/**
 *  this pointcut matches calls to an instance of A not made from an
instance of B
 */
pointcut callsToANotMadeFromB() : call(* *(..)) && target(A) && !this(B);

/**
 * this pointcut matches calls to methods defined for A, where the call site is
 * not lexically within B.
 */
pointcut callsToANotMadeFromBv2() : call(* A.*(..)) && !within(B);

-- Adrian
adrian.colyer@xxxxxxxxx


Back to the top