Results 1 to 1 of 1
- 11-21-2011, 09:16 AM #1Member
- Join Date
- Nov 2011
- Rep Power
Get method parameter values using AspectJ?
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);
I need to capture all calls to Graphics2D.draw(Shape). I have a pointcut that does this:
pointcut captureCallParameters(Shape name) : call(* *(Shape)) && args(name);
The problem is when I try to get the value of the parameter (Shape in this method). I get this parameter: java.awt.geom.Line2D$Double@596e1fb1
Instad I want to get the points for the shape which is a line in this case.
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 Lines and I don't know which one of those Lines is drawn using the Draw(line) method.
- By Anagha in forum New To JavaReplies: 18Last Post: 04-18-2011, 05:39 AM
- By Onra in forum New To JavaReplies: 4Last Post: 03-14-2011, 12:12 AM
- By Dipke in forum New To JavaReplies: 2Last Post: 02-25-2011, 09:18 AM
- By bukake in forum New To JavaReplies: 10Last Post: 09-06-2008, 09:26 PM
- By Java Tip in forum Java TipReplies: 1Last Post: 07-12-2008, 06:24 PM