blob: fa8ec04d282b46c4c1119fa609436ad84ee93c44 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
import org.aspectj.testing.Tester;
import org.aspectj.lang.*;
import org.aspectj.lang.reflect.*;
import java.util.*;
import org.aspectj.examples.Point;
public class Strings {
public static void main(String[] args) {
Point p = new Point(1,1);
p.x += 10;
p.move(20, 20);
try {
throw new UnsupportedOperationException("test");
} catch (UnsupportedOperationException e) {
}
}
}
aspect JoinPoints {
static before(): within(Strings) || instanceof(Point) && !receptions(new(..)) {
System.out.println("tjp-short : " + thisJoinPoint.toShortString());
System.out.println("tjp-default: " + thisJoinPoint);
System.out.println("tjp-long : " + thisJoinPoint.toLongString());
System.out.println();
System.out.println("sig-short : " + thisJoinPoint.getSignature().toShortString());
System.out.println("sig-default: " + thisJoinPoint.getSignature());
System.out.println("sig-long : " + thisJoinPoint.getSignature().toLongString());
System.out.println("--------------------------------------------------------------------------");
}
}
|