file: Main.java
includes all classes
joinpointtype J {}
joinpointtype K extends J {}
joinpointtype L extends K {}
class C exhibits J {
pointcut J : execution(void test());
void test() {
System.out.println("C.test()");
}
}
class D extends C exhibits J, K {
pointcut J : super; // This PC wil never match except test is overwritten
pointcut K : execution(void test2());
// K pointcut : execution(void test2()); // illegal
void test2() {
System.out.println("D.test2()");
}
}
class E extends C exhibits L {
pointcut L : execution(void test3());
void test3() {
System.out.println("E.test3()");
}
// new L() {}
}
aspect X advises J, K {
before (J j) {
System.out.println("\tbefore: "+thisJoinPoint);
}
after (K k) {
System.out.println("\tafter: "+thisJoinPoint);
}
}
Back to main page