Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

AndTypePattern.java 541B

1234567891011121314151617181920212223242526
  1. import java.lang.annotation.Target;
  2. import java.lang.annotation.ElementType;
  3. @Target({ElementType.METHOD})
  4. @interface MethodAnnotation{}
  5. @Target({ElementType.FIELD})
  6. @interface FieldAnnotation{}
  7. public class AndTypePattern {
  8. public void method1() {}
  9. @FieldAnnotation
  10. int field = 1;
  11. }
  12. aspect A {
  13. // should display an xlint message because @FieldAnnotation can't be
  14. // applied to methods
  15. pointcut andPointcut() : execution(@(FieldAnnotation && MethodAnnotation) * *(..));
  16. declare warning : andPointcut() : "andPointcut()";
  17. }