blob: 4a80ba36ded4da2d3c95163eca55b3f37243f16f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
import java.lang.annotation.*;
public class DecaType3 {
public static void main(String[] argv) {
new DecaType3().sayhello();
}
public void sayhello() {
System.err.println("hello world");
}
}
aspect X {
declare @type: DecaType3 : @MyAnnotation;
after(): call(* println(..)) && @this(MyAnnotation) {
System.err.println("advice running");
}
}
@java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.RUNTIME)
@interface MyAnnotation {}
|