blob: c541ba2a4e4cc091577aec453d450b0b43f6f535 (
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
33
34
35
|
package test135.pack;
import org.aspectj.lang.*;
import org.aspectj.lang.reflect.*;
// a first try at a library class in the test suite
public abstract aspect JoinPointFields {
public String className;
public String methodName;
public String[] parameterNames;
public Class[] parameterTypes;
public Object[] parameters;
protected int protectedField = 42;
abstract protected pointcut onTypes();
before(): call(!static * *(..)) && onTypes() && !within(JoinPointFields+) {
System.out.println(thisJoinPoint);
Signature sig = thisJoinPoint.getSignature();
CodeSignature codeSig = (CodeSignature) sig;
//ReceptionJoinPoint rjp = (ReceptionJoinPoint) thisJoinPoint;
className = sig.getDeclaringType().getName();
System.out.println(className);
methodName = sig.getName();
parameterNames = codeSig.getParameterNames();
parameterTypes = codeSig.getParameterTypes();
//parameters = rjp.getParameters();
parameters = thisJoinPoint.getArgs();
System.out.println("DONE: " + thisJoinPoint);
}
}
|