Find if a class extends a specific class or a class that extends that
已回答
Is there a automate way to search if a class extends a specific class or a class that extends that class ?
e.g.
public class A extends B {
}
public class B extends C{
}
I want to see if class A extends class C direct or through another class ( in the example the class B)
请先登录再写评论。
PsiClass#getExtendsList
getExtendsList will give me the class B and then i have to search again if class B extends class C. I wanted to know if is there a better way than searching all the extends hierarchy
getExtendsList is a valid solution. You may implement some recursive function that will return you a list of the classes that you're looking for using the specific stop condition - i.e. your namespace.