Finding the Declaring Class in MethodInvocation [message #93553] |
Thu, 15 March 2007 13:59 |
Anirudh Messages: 22 Registered: July 2009 |
Junior Member |
|
|
Hi,
I am attempting to statically analyze a piece of code. I need to find out
the declaring class for a method being invoked. For this, i am getting all
the methods invoked in a class (or in a method). I obtain an instance of
MethodInvocation. From this i can obtain the name of the method being
invoked, but i do not know how to obtain the declaring class.
To illustrate:
SomeClass sc = new SomeClass();
sc.callAMethod();
MethodInvocation can tell me the name of the method (callAMethod) and also
the name of the type (sc), but i cannot directly obtain the declaring type
(SomeClass).
Is there any way i can do this? Is using MethodInvocation the wrong way of
doing this? I am using TPTP's static analysis and trying to plug in my own
rule.
Thanks in advance,
Anirudh
|
|
|
Powered by
FUDForum. Page generated in 0.02019 seconds