aboutsummaryrefslogtreecommitdiffstats
path: root/tests/java5/ataspectj/coverage/Test043.java
blob: f6abcc242e23983da16f50d9b6974aa1a7f7387c (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
//"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());
   }
}