本文整理匯總了Java中com.intellij.psi.PsiClass.isInheritor方法的典型用法代碼示例。如果您正苦於以下問題:Java PsiClass.isInheritor方法的具體用法?Java PsiClass.isInheritor怎麽用?Java PsiClass.isInheritor使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.intellij.psi.PsiClass
的用法示例。
在下文中一共展示了PsiClass.isInheritor方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: computeChildren
import com.intellij.psi.PsiClass; //導入方法依賴的package包/類
@Override
protected MultiMap<PsiFile, ClassNode> computeChildren(@Nullable PsiFile psiFile) {
MultiMap<PsiFile, ClassNode> children = new MultiMap<>();
children.putValue(aggregateRoot.getContainingFile(), new AggregateRootNode(this, aggregateRoot));
Project project = getProject();
if (project != null) {
JavaPsiFacade javaPsiFacade = JavaPsiFacade.getInstance(project);
PsiClass entityInterface = javaPsiFacade.findClass(ENTITY_INTERFACE, GlobalSearchScope.allScope(project));
PsiClass valueObjectInterface = javaPsiFacade.findClass(VO_INTERFACE, GlobalSearchScope.allScope(project));
if (entityInterface != null && valueObjectInterface != null) {
for (PsiClass psiClass : psiPackage.getClasses(GlobalSearchScope.allScope(project))) {
if (psiClass.isInheritor(entityInterface, true) && !psiClass.equals(aggregateRoot)) {
children.putValue(psiClass.getContainingFile(), new EntityNode(this, psiClass));
} else if (psiClass.isInheritor(valueObjectInterface, true)) {
children.putValue(psiClass.getContainingFile(), new ValueObjectNode(this, psiClass));
}
}
}
}
return children;
}