Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

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. }