blob: 22f60ff8a44c9a63275fe3412f4e51b2f3ba7429 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
import java.lang.annotation.*;
interface Marker {}
@Retention(RetentionPolicy.RUNTIME) @interface Color { String value();}
// Color put on a particular type, marker interface added to any types with Color annotation
// Deca specified first
public aspect DecaDecpInteractions1 {
declare @type: A : @Color("red");
declare parents: @Color * implements Marker;
}
aspect X {
before(): execution(* *(..)) && this(Marker) {
System.err.println("Marker interface identified on "+thisJoinPoint);
}
before(): execution(* *(..)) && @this(Color) {
System.err.println("Color annotation identified on "+thisJoinPoint);
}
}
|