diff options
Diffstat (limited to 'tests/java5/annotations/declare/DecaDecpInteractions4.aj')
-rw-r--r-- | tests/java5/annotations/declare/DecaDecpInteractions4.aj | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/java5/annotations/declare/DecaDecpInteractions4.aj b/tests/java5/annotations/declare/DecaDecpInteractions4.aj new file mode 100644 index 000000000..4e442747b --- /dev/null +++ b/tests/java5/annotations/declare/DecaDecpInteractions4.aj @@ -0,0 +1,24 @@ +import java.lang.annotation.*; + +interface Marker {} + +@Retention(RetentionPolicy.RUNTIME) @interface Color { String value();} + +// Put the marker interface on a particular type and add the annotation on +// types with that interface. +// decp specified first +public aspect DecaDecpInteractions4 { + + declare parents: A* implements Marker; + + declare @type: Marker+ : @Color("red"); +} + +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); + } +} |