package a;
Class X
public fX(int i, String s);
package b;
Class Y
public fY(String arg1, String arg2, int arg3){
...
ClassX.fX(1,"testY");
// Need to execute some stuff right here after this call
}
Class Z
public fZ(int n, int m){
ClassX.fX(2,"testZ");
}
訪問函數調用參數,我需要這樣一個切入點和建議,這將ClassX.fX後右鍵點 (1,「暴躁」)方法調用,並給我訪問 到ClassY.fY (ARG1字符串,字符串ARG2,INT ARG3)函數調用的參數(即ARG1,ARG2和參數3)在同一時間,的Java通過的AspectJ
我想這一個,但它沒有工作。
pointcut ParameterPointCut(String arg1, String arg2, int arg3) :
withincode (public String ClassY.fY(String,String,int))&&
call(public String ClassX.fX(int, String)) &&
args(arg1,arg2,arg3);
after(String arg1, String arg2, int arg3): ParameterPointCut(arg1,arg2,arg3){
System.out.println("arg1 =" + arg1);
}
什麼是切入點和建議的更改將這些值在正確的位置?
在此先感謝。