Eclipse - 看一个类的哪些方法在另一个类中使用? [英] Eclipse - see which methods of one class are used in another?
问题描述
使用Eclipse,给出以下类:
With Eclipse, given the following classes:
class Dao {
public void one() {}
public void two() {}
public void three() {}
}
class ServiceA {
Dao dao;
public void a() {
dao.one();
dao.two();
}
public void b() {
dao.one();
}
}
class ServiceB {
Dao dao;
public void z() {
dao.two();
dao.three();
}
}
...是否可以看到所有 Dao
从 ServiceA
引用的方法?我正在寻找一个视图,显示 ServiceA
使用 one()
和两个()
(如果 one()
被列出两次,不要介意。
... is it possible to see a list of all Dao
methods referenced from ServiceA
? I'm looking for one view that will show that ServiceA
uses one()
and two()
(don't mind it if one()
is listed twice).
我知道如何看到一个具体方法的呼叫者。我真的需要一个类中引用的所有方法的列表。想想旧的代码数量级更大:道具和服务有几十(几百)的方法。
I know how to see callers of one specific method. I really need a list of all methods referenced within a class. Think of legacy code orders of magnitude larger: dao and services that have tens (hundreds?) of methods. I don't feel like going through call hierarchy method by method.
推荐答案
实际上您可以通过鼠标右键单击Dao方法然后单击打开呼叫层次结构Ctrl + Alt + H,Eclipse将为您找到所有Dao方法调用。
Actually you can click by right mouse button at Dao method and then click at 'Open Call Hierarchy Ctrl+Alt+H' and Eclipse will find for you all Dao method calls.
这篇关于Eclipse - 看一个类的哪些方法在另一个类中使用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!