I need to parse specific method invocation calls, including all the signature from some Java classes, for example.
public class MyClass {
public void myMthod() {
result = someInstance.someOtherMethod(param1, param2);
}
}
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 will be the fastest way to achieve this? I was thinking about using a RegEx parser. The problem is that there are several entry patterns, for example.
a)
result = someInstance.someOtherMethod(getSomething(), param);
b)
result =
getSomeInstance().someOtherMethod(param);
c)
result = getSomeInstance()
.someOtherMethod(
getSomethingElse(), null, param);
Any help would be really appreciated! Thank!
Peter source
share