I am using AspectJ to capture method calls. Then I need to get the method name and the parameter values passed. Let s have the following example:
Line2D line = new Line2D.Double(lineStart, lineEnd);
and graphics.draw(line);
我需要抓住所有电话
pointcut captureCallParameters(Shape name) : call(* *(Shape)) && args(name);
问题在于我试图获得参数的价值(这种方法中的沙伯)。 我拿到这个参数:java.awt.geom.Line2D$Double@596e1fb1
。
在Instad,我想得到在此情况下的形状点。
On the other hand I have also a pointcut that matches the construction of the new line mentioned above and I am able to get the parameters of that line. BUT I don t know how to relate the Draw method with that line constructor. I can have several constructors for Line
s and I don t know which one of those Line
s is drawn using the Draw(line)
method.