You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

BindingWithAnnotatedItds1.aj 561B

1234567891011121314151617181920212223242526
  1. // Annotated ITD (method) being matched upon and extracted
  2. import java.lang.annotation.*;
  3. @Retention(RetentionPolicy.RUNTIME) @interface Fruit { String value();}
  4. public aspect BindingWithAnnotatedItds1 {
  5. @Fruit("apple") int A.m() { return 1; }
  6. public static void main(String[]argv) {
  7. A a = new A();
  8. a.m();
  9. }
  10. }
  11. class A { }
  12. aspect X {
  13. before(Fruit f): execution(* *(..)) && @annotation(f) {
  14. System.err.println("Found "+f.value()+" at jp "+thisJoinPoint+
  15. " ("+thisJoinPoint.getSourceLocation()+")");
  16. }
  17. }