Briefly speaking, I am working on developing a system which is able to give you information about the results provided by the execution of a java program. I have considered the following problem, and I do not know if it is possible to solve it in java.
I have the following classes:
public class ClassA {
ClassB classB= new ClassB();
public Integer method1(){
return classB.method2();
}
}
public class ClassB {
ClassC classC = new ClassC();
public Integer method2() {
return this.classC.method3() + this.classC.method4();
}
}
public class ClassC {
public Integer method3() {
return 3;
}
public Integer method4() {
return 4;
}
}
So far I can capture each invocation of the methods by using dynamic proxies. In particular, I am using the Proxy and the InvocationHandler objects from the package java.lang.reflect. Here there is the example I followed (https://www.concretepage.com/java/dynamic-proxy-with-proxy-and-invocationhandler-in-java).
My question is if someone knows how can I give information such as: "the return of method1() is generated from the return of method2(), and the return of method2() is in turn generated from the return of method3() and the return of method4()".