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