дзеркало
https://github.com/eclipse-aspectj/aspectj.git
synced 2024-08-27 05:54:38 +02:00
28 рядки
466 B
Java
28 рядки
466 B
Java
class Foo {
|
|
|
|
public static void main(String[] args) {
|
|
(new Foo()).m1();
|
|
System.out.println("---");
|
|
(new Bar()).m1();
|
|
}
|
|
|
|
public void m1() { }
|
|
}
|
|
|
|
class Bar extends Foo {
|
|
public void m1() { super.m1(); }
|
|
}
|
|
|
|
aspect A {
|
|
static before(): instanceof(Foo) && executions(public * *(..)) {
|
|
System.out.println("executions");
|
|
}
|
|
|
|
|
|
static before(): instanceof(Foo) && receptions(public * *(..)) {
|
|
System.out.println("receptions");
|
|
}
|
|
|
|
}
|
|
|