Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] How do I apply advice to a subclass method?

if you have

public class A {
  public void foo() {...}
}
public class B extends A {
  public void foo() {...}
}

You can reference any class and subclass of A with "A+", e.g.,

pointcut foo(): call (void A+.foo()) ...

If you don't want to advise A.foo() itself,

pointcut foo(): call (void A+.foo()) && !call(void A.foo()) ...

HTH,
dean

On Nov 14, 2007, at 1:03 PM, Tamim Khan wrote:

How do I apply advice to a subclass method?

Thanks and regards,
AK
_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/aspectj-users

Dean Wampler, Ph.D.
dean at objectmentor.com
http://www.objectmentor.com
See also:
http://www.aspectprogramming.com  AOP advocacy site
http://aquarium.rubyforge.org     AOP for Ruby
http://www.contract4j.org         Design by Contract for Java5

I want my tombstone to say:
  Unknown Application Error in Dean Wampler.exe.
  Application Terminated.
      [Okay]        [Cancel]





Back to the top