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.

MultiTypePatterns.java 642B

12345678910111213141516171819202122232425
  1. // testing what happens with multiple annotations together in a type pattern list @(A B C) type thing
  2. enum Rainbow { RED, ORANGE, YELLOW, GREEN, BLUE, INDIGO, VIOLET }
  3. @interface Col1 { Rainbow value() default Rainbow.RED; }
  4. @interface Col2 { Rainbow value() default Rainbow.YELLOW; }
  5. aspect X {
  6. before(): execution(@(Col1 && Col2) * *(..)) {
  7. System.err.println("advising "+thisJoinPoint);
  8. }
  9. }
  10. public class MultiTypePatterns {
  11. public static void main(String[] args) {
  12. MultiTypePatterns eOne = new MultiTypePatterns();
  13. }
  14. @Col1 public void m001() {}
  15. @Col2 public void m002() {}
  16. @Col1 @Col2 public void m003() {}
  17. }