blob: c16889dc7f32fd2526eb769eae0bdf92e345acf7 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
import org.aspectj.testing.Tester;
public class NamedCrosscuts {
crosscut fooCut(Foo f): void foo() && f;
static advice(Foo f): fooCut(f) {
before {
System.err.println("before advice");
}
}
crosscut allMethodsCut(): * && !(NamedCrosscuts) && !abstract * *(..);
static advice(): allMethodsCut() {
before {
System.err.println("method: "+thisJoinPoint.methodName);
}
}
public static void test() {
new Foo().foo();
}
public static void main(String[] args) {
test();
}
}
class Foo {
void foo() {}
}
|