diff options
Diffstat (limited to 'tests/java5/ataspectj/coverage/Test043.java')
-rw-r--r-- | tests/java5/ataspectj/coverage/Test043.java | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/java5/ataspectj/coverage/Test043.java b/tests/java5/ataspectj/coverage/Test043.java new file mode 100644 index 000000000..f6abcc242 --- /dev/null +++ b/tests/java5/ataspectj/coverage/Test043.java @@ -0,0 +1,27 @@ +//"The Moody example" + +import org.aspectj.lang.annotation.*; + +class Mood{ +} +@Aspect +class MoodIndicator { + + public interface Moody { + Mood getMood(); + }; + + @DeclareParents("org.xzy..*") + class MoodyImpl implements Moody { + private Mood mood = new Mood(); + + public Mood getMood() { + return mood; + } + } + + @Before("execution(* *.*(..)) && this(m)") + void feelingMoody(Moody m) { + System.out.println("I'm feeling " + m.getMood()); + } +} |