I am using Eclipse IDE for my Java project. I need a list of methods which are being called from a particular class i.e. I need to see a list of all the methods which are being called from a class but not declared in that. I am looking for some option which might be there in Eclipse already. I am not willing to write a code for this (that will be my last choice).
Let me explain using this example -
public class ABC {
public void methodA {
System.out.println("In methodA");
BCD bcd = new BCD();
bcd.callMethodAA(); // defined in class BCD
}
public void methodB {
System.out.println("In methodB");
CDE cde = new CDE();
cde.callMethodBB(); // defined in class CDE
}
}
I want an option which will show me - From Class ABC we are calling - a) callMethodAA b) callMethodBB
If it is at runtime, you could use a Dynamic Proxy. The dynamic proxy is called before the method invocations of your class and you can log somewhere (to another class, or a file or whatever) which methods have been called.