Hi, I need to parse certain method invocation calls including the whole signature out of some Java classes, e.g.
public class MyClass {
public void myMthod() {
// ... some code here
result = someInstance.someOtherMethod(param1, param2);
// ... some other code here
}
}
As a result I would like to get something like:
serviceName = someInstance
methodName = someOtherMethod
arguments = {
argument = java.lang.String,
argument = boolean
}
result = java.lang.Long
What would be the fastest way to achieve this? I was thinking about using a RegEx parser. The problem there is there are several occurence patterns, e.g.
a)
result = someInstance.someOtherMethod(getSomething(), param);
b)
result =
getSomeInstance().someOtherMethod(param);
c)
result = getSomeInstance()
.someOtherMethod(
getSomethingElse(), null, param);
Any help would be really appreciated! Thanks!