summaryrefslogtreecommitdiffstats
path: root/tests/java5/annotations/binding/BindingWithAnnotatedItds1.aj
blob: 0c2ac3079bacec7f05c381c6776a4f7c020aafdf (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
// Annotated ITD (method) being matched upon and extracted
import java.lang.annotation.*;

@Retention(RetentionPolicy.RUNTIME) @interface Fruit { String value();}

public aspect BindingWithAnnotatedItds1 {

  @Fruit("apple") int A.m() { return 1; }
  
  public static void main(String[]argv) {
    A a = new A();
    a.m();
  }
  
}

class A { }

aspect X {

  before(Fruit f): execution(* *(..)) && @annotation(f) {
    System.err.println("Found "+f.value()+" at jp "+thisJoinPoint+
                       " ("+thisJoinPoint.getSourceLocation()+")");
  }
  
}