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.

Fourteen.java 572B

12345678910111213141516171819202122
  1. public class Fourteen {
  2. public static void main(String[] argv) {
  3. Fourteen a = new Fourteen();
  4. a.m("abc");
  5. }
  6. public void m(String s) {
  7. System.out.println("Method m() running");
  8. }
  9. }
  10. aspect X {
  11. static boolean printit(Object o) {
  12. System.out.println("instance is "+o.getClass().getName());
  13. return true;
  14. }
  15. before(String s):args(s) && execution(* m(..)) && if(printit(thisAspectInstance)) && if(thisJoinPointStaticPart.toString().indexOf("Fourteen")!=-1) {
  16. System.out.println("In advice() arg="+s+" tjpsp="+thisJoinPointStaticPart);
  17. }
  18. }