summaryrefslogtreecommitdiffstats
path: root/tests/java5/annotations/ajdkExamples/AnnotationPatternMatching.aj
blob: 23be9d78504cee48e609f12be8d7cd4e7559733d (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
import org.xyz.*;

public aspect AnnotationPatternMatching {

	declare warning : execution(@Immutable * *(..)) : "@Immutable";
	
	declare warning : execution(!@Persistent * *(..)) : "!@Persistent";
	
	declare warning : execution(@Foo @Goo * *(..)) : "@Foo @Goo";
	
	declare warning : execution(@(Foo || Goo) * *(..)) : "@(Foo || Goo)";
	
	declare warning : execution(@(org.xyz..*) * *(..)) : "@(org.xyz..*)";
	
}

@interface Immutable {}
@interface Persistent {}
@interface Foo{}
@interface Goo{}


class Annotated {
	
	@Immutable void m1() {}
	
	@Persistent void m2() {}
	
	@Foo @Goo void m3() {}
	
	@Foo void m4() {}
	
	@OrgXYZAnnotation void m5() {}
	
}