0
我想通過收集特定的方法都明確和implicitly.For例如調用的方法:如何收集Java方法中調用的方法
Class A {
@Autowired
C c;
foo() {
B b = new B();
b.print("abc");
if (somecondition) {
c.anotherPrint("def");
}
}
Class B {
print(String arg) {
}
}
Class C {
@Autowired
B b;
anotherPrint(String arg) {
b.print(arg);
}
}
從上面的代碼,我想收集到的信息,一個類的方法富調用B的print()方法與參數「ABC」和「DEF」 .Something像調用圖
A::foo
--> B::print("abc")
--> C::anotherPrint("def")
--> B::print("def")
作爲一個恐懼問題,我想你應該先研究一些現有的解決方案,比如https://github.com/gousiosg/java-callgraph。另請參閱https://stackoverflow.com/questions/4951517/static-analysis-of-java-call-graph – fvu