本文整理汇总了Java中com.jetbrains.php.lang.psi.elements.PhpClass.getSuperClass方法的典型用法代码示例。如果您正苦于以下问题:Java PhpClass.getSuperClass方法的具体用法?Java PhpClass.getSuperClass怎么用?Java PhpClass.getSuperClass使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.jetbrains.php.lang.psi.elements.PhpClass
的用法示例。
在下文中一共展示了PhpClass.getSuperClass方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: buildVisitor
import com.jetbrains.php.lang.psi.elements.PhpClass; //导入方法依赖的package包/类
@NotNull
@Override
public PsiElementVisitor buildVisitor(@NotNull ProblemsHolder problemsHolder, boolean isOnTheFly) {
return new PhpElementVisitor() {
@Override
public void visitPhpClass(PhpClass clazz) {
if (clazz.getSuperClass() != null && clazz.getSuperClass().getFQN().equals("\\yii\\db\\ActiveQuery")) {
PhpIndex index = PhpIndex.getInstance(clazz.getProject());
PhpClass activeRecordClass = ClassUtils.findClassInSeeTags(index, clazz, "\\yii\\db\\BaseActiveRecord");
if (activeRecordClass == null) {
problemsHolder.registerProblem(clazz.getFirstChild(),
"Can not find connected ActiveRecord class.\nYou should add @see tag with linked ActiveRecord",
ProblemHighlightType.WEAK_WARNING);
}
}
super.visitPhpClass(clazz);
}
};
}
示例2: processClass
import com.jetbrains.php.lang.psi.elements.PhpClass; //导入方法依赖的package包/类
private static void processClass(@NotNull PhpClass clazz, @NotNull Set<PhpClass> processed) {
if (clazz.isInterface()) {
throw new InvalidParameterException("Interface shall not be provided");
}
processed.add(clazz);
/* re-delegate interface handling */
for (PhpClass anInterface : clazz.getImplementedInterfaces()) {
processInterface(anInterface, processed);
}
/* handle parent class */
if (null != clazz.getSuperClass()) {
processClass(clazz.getSuperClass(), processed);
}
}
示例3: isImplementationOfInterface
import com.jetbrains.php.lang.psi.elements.PhpClass; //导入方法依赖的package包/类
protected boolean isImplementationOfInterface(PhpClass phpClass, PhpClass phpInterface) {
if (phpClass == phpInterface) {
return true;
}
for (PhpClass implementedInterface : phpClass.getImplementedInterfaces()) {
if (isImplementationOfInterface(implementedInterface, phpInterface)) {
return true;
}
}
if (null == phpClass.getSuperClass()) {
return false;
}
return isImplementationOfInterface(phpClass.getSuperClass(), phpInterface);
}
示例4: isInstanceOf
import com.jetbrains.php.lang.psi.elements.PhpClass; //导入方法依赖的package包/类
public boolean isInstanceOf(@NotNull PhpClass subjectClass, @NotNull PhpClass expectedClass) {
// we have equal class instance, on non multiple classes with same name fallback to namespace and classname
if (subjectClass == expectedClass || PhpElementsUtil.isEqualClassName(subjectClass, expectedClass)) {
return true;
}
if (expectedClass.isInterface()) {
return isImplementationOfInterface(subjectClass, expectedClass);
}
if (null == subjectClass.getSuperClass()) {
return false;
}
return isInstanceOf(subjectClass.getSuperClass(), expectedClass);
}