JDT AST: Finding whether a callee method returns value of an instance variable [message #992588] |
Sat, 22 December 2012 02:37 |
Bhanuka Withana Messages: 1 Registered: December 2012 |
Junior Member |
|
|
I'm using Eclipse JDT AST to parse a given java source code. While parsing the code, when it hits a method invocation, I want to find out whether that particular method returns or sets a value of an instance variable (basically to find out whether the callee method is a getter/setter of the same class of caller method).
E.g.:
public void test(){
//when parsing the following line I want to check whether "getName"
//returns a value of an instance variable.
String x = getName();
//when parsing the following line I want to check whether "setName"
//sets the value of an instance variable.
setName("some-name");
}
I've used the AST plugin also find out a possible path which would help me to refer it from the API, but couldn't. Please let me know whether this is possible and if so, which approach that would help me to get the required information.
|
|
|
Powered by
FUDForum. Page generated in 0.02983 seconds