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.

BindingInts5.java 451B

12345678910111213141516171819202122232425
  1. import java.lang.annotation.*;
  2. @Retention(RetentionPolicy.RUNTIME)
  3. @interface Foo {
  4. String s() default "abc";
  5. int i() default 37;
  6. }
  7. public class BindingInts5 {
  8. public static void main(String []argv) {
  9. BindingInts5 inst = new BindingInts5();
  10. inst.a();
  11. inst.b();
  12. }
  13. @Foo
  14. void a() {}
  15. void b() {}
  16. }
  17. aspect X {
  18. before(int i): execution(* a(..)) && @annotation(Foo(i)) {
  19. System.out.println(thisJoinPointStaticPart+" "+i);
  20. }
  21. }