vendredi 16 octobre 2020

Java method flow and parameters data type during runtime with java reflection?

Just to clarify my question: Let's say we have three class A, B and C. In class C object of A and B class are created and a sequence of methods are called. Is it possible to get information about the method flow during runtime by using reflection? Moreover, how to find which type of parameters are passed to the individual methods?

class A
{
foo(int aInput);
//returns string
}

class B
{
bar(String bString);
}

class C
{
B b= new B;
A a = new A;

test(int testInput)
{
String aOutput = a.foo(testInput);
String bOutput= b.bar(aOutput);
}
}

Method flow information test()->a.foo()->b.bar and test() method parameter = int.





Aucun commentaire:

Enregistrer un commentaire