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.

Five.java 445B

123456789101112131415161718192021
  1. public class Five {
  2. public static void main(String[] argv) {
  3. Five a = new Five();
  4. a.m("abc");
  5. }
  6. public void m(String s) {
  7. System.out.println("Method m() running");
  8. }
  9. }
  10. aspect X {
  11. boolean doit() {
  12. System.out.println("In instance check method doit()");
  13. return true;
  14. }
  15. before():execution(* m(..)) && if(thisAspectInstance.doit()){
  16. System.out.println("In advice() arg0="+thisJoinPoint.getArgs()[0]);
  17. }
  18. }