Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] Pointcut question to simply subaspects

If I have a pointcut like the following:

public aspect TypeSpecificAspect {
  public pointcut accessingTarget():
    call(Person+.new(..)) || call(* Person+.*(..)) || get(* Person+.*) || set(* Person+.*);
}

I'd like to push the pointcut up into a superaspect so that all the subaspect would have to supply is the actual type _expression_ (in this case, Person).  Something like the following:

public aspect Super {
  public abstract pointcut theType();
  public pointcut accessingTarget(): /* demonstrating the point -- doesn't compile */
    call(thisType()+.new(..)) || call(* thisType()+.*(..)) || get(* thisType()+.*) || set(* thisType()+.*);
}
=====
public aspect Sub extends Super {
  public pointcut theType():  Person;
}

How can I achieve what I hope you understand I mean?

Thanks,
Matthew

Back to the top