Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

CaseThree.java 704B

12345678910111213141516171819202122232425262728293031323334
  1. // CaseThree - ambiguous
  2. import java.lang.annotation.*;
  3. public class CaseThree {
  4. public static void main(String []argv) {
  5. CaseThree o = new CaseThree();
  6. o.a();
  7. o.b();
  8. o.c();
  9. o.d();
  10. o.e();
  11. }
  12. public void a() {}
  13. @Anno(Level.NONE) public void b() {}
  14. @Anno(Level.ONE) public void c() {}
  15. @Anno(Level.TWO) public void d() {}
  16. @Anno(Level.THREE) public void e() {}
  17. }
  18. enum Level { NONE, ONE, TWO, THREE; }
  19. @Retention(RetentionPolicy.RUNTIME)
  20. @interface Anno { Level value(); Level foo() default Level.ONE;}
  21. aspect X {
  22. before(Level l): execution(@Anno !@Anno(Level.NONE) * *(..)) && @annotation(Anno(l)) {
  23. System.out.println(l);
  24. }
  25. }