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.

Eight.java 495B

il y a 13 ans
123456789101112131415161718192021222324252627
  1. public class Eight {
  2. public static void main(String[] argv) {
  3. Eight a = new Eight();
  4. a.m();
  5. }
  6. public void m() {
  7. System.out.println("Method m() running");
  8. }
  9. }
  10. abstract aspect Y {
  11. abstract pointcut p();
  12. before(): execution(* m(..)) && p() {
  13. System.out.println("In advice()");
  14. }
  15. }
  16. aspect X extends Y {
  17. pointcut p(): if(thisAspectInstance.doit());
  18. boolean doit() {
  19. System.out.println("in doit(): class="+this.getClass().getName());
  20. return true;
  21. }
  22. }