[英]IntelliJ IDEA: Is there a way to list all interfaces implemented by a class and its parents?
I work on a relatively complex Java project where classes commonly have four or five ancestors before Object
. 我从事一个相对复杂的Java项目,其中类通常在Object
之前有四个或五个祖先。 Given such a class, eg D
in a hierarchy like this: Object > A > B > C > D
, I would like to know what all interfaces it effectively implements. 给定这样一个类,例如像这样的层次结构中的D
: Object > A > B > C > D
,我想知道它有效实现的所有接口。 That is, I am also interested in seeing that D
implements, say, Serializable
even if that is declared only in the declaration of class B
and even when D
does not actually implement any of the methods specified by the interface (naturally, if talking about Serializable
). 也就是说,我也有兴趣看到D
实现了Serializable
即使它只在B
类声明中声明,即使D
实际上没有实现接口指定的任何方法(当然,如果谈论的话) Serializable
)。
Some potential sources of this information I tried include: 我尝试过的这些信息的一些潜在来源包括:
Is there a way to obtain this information in IDEA without having to open files of all ancestor classes of the class in question? 有没有办法在IDEA中获取此信息而无需打开相关类的所有祖先类的文件?
You can try 你可以试试
If you are fine with UML representation, then use 如果您对UML表示没问题,那么请使用
Press ⌥⇧⌘U
or ⌥⌘U
on mac 在mac上按⌥⇧⌘U
或⌥⌘U
Press Ctrl+Shift+Alt+U
or Ctrl+Alt+U
on default windows keymap 在默认的Windows键盘映射上按Ctrl+Shift+Alt+U
或Ctrl+Alt+U
See https://www.jetbrains.com/help/idea/2016.3/viewing-class-hierarchy-as-a-class-diagram.html 请参阅https://www.jetbrains.com/help/idea/2016.3/viewing-class-hierarchy-as-a-class-diagram.html
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.