blob: e655e5954e6907e0391f85ee122bc9db3a622b73 (
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
|
package test;
import java.util.List;
public aspect MyAspect {
List<String> Demo.list = null;
declare @type : Demo : @Deprecated;
int Demo.x = 5;
void Demo.foo(List<String> x) {
MyAspect.hasAspect();
}
public Demo.new(int x) {
this();
}
declare warning : execution(* *.nothing(..)) : "blah";
declare error : execution(* *.nothing(..)) : "blah";
declare soft : Exception : execution(* *.nothing(..));
protected pointcut s():
call(String Demo.toString(..));
before (): s() {
}
after (): s() {
}
void around (): s() {
proceed();
return;
}
after () returning(): s() {
}
after () throwing(): s() {
thisEnclosingJoinPointStaticPart.getClass();
thisJoinPoint.getClass();
thisJoinPointStaticPart.getClass();
}
@interface MyAnnotation { }
// try out declare annotation
declare @field: int Demo.x: @MyAnnotation;
declare @method: void Demo.foo(..): @MyAnnotation;
declare @constructor: public Demo.new(int): @MyAnnotation;
}
|