@Override public String getCanonicalText() { if (myCanonicalText == null) { assert mySubstitutor.isValid(); StringBuilder buffer = new StringBuilder(); buildText(myClass, mySubstitutor, buffer, true, false); myCanonicalText = buffer.toString(); } return myCanonicalText; }
public PsiImmediateClassType( @NotNull PsiClass aClass, @NotNull PsiSubstitutor substitutor, @Nullable LanguageLevel level, @NotNull PsiAnnotation... annotations) { super(level, annotations); myClass = aClass; myManager = aClass.getManager(); mySubstitutor = substitutor; assert substitutor.isValid(); }
@Override public boolean isAvailable(@NotNull Project project, Editor editor, PsiFile file) { if (!myTargetMethod.isValid() || myTargetMethod.getContainingClass() == null) return false; for (PsiExpression expression : myExpressions) { if (!expression.isValid()) return false; } if (!mySubstitutor.isValid()) return false; myNewParametersInfo = getNewParametersInfo(myExpressions, myTargetMethod, mySubstitutor); if (myNewParametersInfo == null || formatTypesList(myNewParametersInfo, myContext) == null) return false; return !isMethodSignatureExists(); }
@Override public boolean isValid() { return myClass.isValid() && mySubstitutor.isValid(); }