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