Java 类com.intellij.psi.PsiInstanceOfExpression 实例源码

项目:intellij-ce-playground    文件:InstanceofInterfacesInspection.java   
@Override
public void visitInstanceOfExpression(
  @NotNull PsiInstanceOfExpression expression) {
  super.visitInstanceOfExpression(expression);
  final PsiTypeElement typeElement = expression.getCheckType();
  if (!ConcreteClassUtil.typeIsConcreteClass(typeElement,
                                             ignoreAbstractClasses)) {
    return;
  }
  if (typeElement == null) {
    return;
  }
  registerError(typeElement);
}
项目:tools-idea    文件:InstanceofInterfacesInspection.java   
@Override
public void visitInstanceOfExpression(
  @NotNull PsiInstanceOfExpression expression) {
  super.visitInstanceOfExpression(expression);
  final PsiTypeElement typeElement = expression.getCheckType();
  if (!ConcreteClassUtil.typeIsConcreteClass(typeElement,
                                             ignoreAbstractClasses)) {
    return;
  }
  if (typeElement == null) {
    return;
  }
  registerError(typeElement);
}
项目:consulo-java    文件:RedundantInstanceofFix.java   
@Override
public void applyFix(@NotNull Project project, @NotNull ProblemDescriptor descriptor)
{
    final PsiElement psiElement = descriptor.getPsiElement();
    if(psiElement instanceof PsiInstanceOfExpression)
    {
        PsiExpression compareToNull = JavaPsiFacade.getInstance(psiElement.getProject()).getElementFactory().
                createExpressionFromText(((PsiInstanceOfExpression) psiElement).getOperand().getText() + " != null", psiElement.getParent());
        psiElement.replace(compareToNull);
    }
}
项目:consulo-java    文件:InstanceofInterfacesInspection.java   
@Override
public void visitInstanceOfExpression(
  @NotNull PsiInstanceOfExpression expression) {
  super.visitInstanceOfExpression(expression);
  final PsiTypeElement typeElement = expression.getCheckType();
  if (!ConcreteClassUtil.typeIsConcreteClass(typeElement,
                                             ignoreAbstractClasses)) {
    return;
  }
  if (typeElement == null) {
    return;
  }
  registerError(typeElement);
}
项目:Android_Lint_SRP_Practice_Example    文件:PsiClassStructureDetector.java   
@Override
public void visitInstanceOfExpression(PsiInstanceOfExpression expression) {
    mVisitor.report("PsiInstanceOfExpression", expression.getText(), expression);
    super.visitExpression(expression);
}