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.

IntValueMatching.java 915B

1234567891011121314151617181920212223242526272829303132
  1. import java.lang.annotation.*;
  2. public class IntValueMatching {
  3. public static void main(String[] args) {
  4. }
  5. @Anno(ival=3) public void a() {}
  6. @Anno(ival=5) public void b() {}
  7. }
  8. enum Color { RED, GREEN, AMBER }
  9. @Retention(RetentionPolicy.RUNTIME)
  10. @interface Anno {
  11. int ival();
  12. }
  13. aspect X {
  14. before(): execution(@Anno(ival=5) * *(..)) {}
  15. // before(): execution(@Anno(bval=5) * *(..)) {}
  16. // before(): execution(@Anno(cval='5') * *(..)) {}
  17. // before(): execution(@Anno(jval=32232323) * *(..)) {}
  18. // before(): execution(@Anno(dval=5.0) * *(..)) {}
  19. // before(): execution(@Anno(zval=true) * *(..)) {}
  20. // before(): execution(@Anno(sval=42) * *(..)) {}
  21. // before(): execution(@Anno(enumval=Color.GREEN) * *(..)) {}
  22. // before(): execution(@Anno(strval="Hello") * *(..)) {}
  23. // before(): execution(@Anno(clazzval=String.class) * *(..));
  24. // before(): execution(@Anno(arrayval={1,2,3}) * *(..));
  25. }