void (RefEntity refElement, @NotNull StringBuilder buf, final boolean isPackageIncluded) { if (refElement instanceof RefImplicitConstructor) { buf.append(JavaBundle.message("inspection.export.results.implicit.constructor")); buf.append("&nbsp;"); refElement = ((RefImplicitConstructor)refElement).getOwnerClass(); } buf.append(HTMLComposerImpl.CODE_OPENING); if (refElement instanceof RefField field) { UField psiField = field.getUastElement(); buf.append(XmlStringUtil.escapeString(psiField.getType().getPresentableText())); buf.append(HTMLComposerImpl.NBSP); } else if (refElement instanceof RefMethod method) { UMethod psiMethod = method.getUastElement(); PsiType returnType = psiMethod.getReturnType(); if (returnType != null) { buf.append(XmlStringUtil.escapeString(returnType.getPresentableText())); buf.append(HTMLComposerImpl.NBSP); } } buf.append(HTMLComposerImpl.A_HREF_OPENING); buf.append(((RefElementImpl)refElement).getURL()); buf.append("\""); if (isPackageIncluded) { buf.append(" qualifiedname=\""); buf.append(refElement.getQualifiedName()); buf.append("\""); } buf.append(">"); if (refElement instanceof RefClass && ((RefClass)refElement).isAnonymous()) { buf.append(AnalysisBundle.message("inspection.reference.anonymous")); } else if (refElement instanceof RefJavaElement && ((RefJavaElement)refElement).isSyntheticJSP()) { buf.append(XmlStringUtil.escapeString(refElement.getName())); } else if (refElement instanceof RefMethod) { UMethod psiMethod = ((RefMethod)refElement).getUastElement(); buf.append(psiMethod.getName()); } else if (refElement instanceof RefFunctionalExpression) { UExpression functionalExpr = ((RefFunctionalExpression)refElement).getUastElement(); if (functionalExpr instanceof ULambdaExpression) { buf.append(refElement.getName()); } else if (functionalExpr instanceof UCallableReferenceExpression) { buf.append(functionalExpr.asSourceString()); } } else { buf.append(refElement.getName()); } buf.append(HTMLComposerImpl.A_CLOSING); if (refElement instanceof RefMethod refMethod) { PsiMethod psiMethod = refMethod.getUastElement().getJavaPsi(); appendMethodParameters(buf, psiMethod, false); } buf.append(HTMLComposerImpl.CODE_CLOSING); final RefEntity owner = refElement.getOwner(); if (owner != null) { if ((refElement instanceof RefClass && ((RefClass)refElement).isAnonymous())) { buf.append(" "); buf.append(AnalysisBundle.message("inspection.export.results.anonymous.ref.in.owner")); buf.append(" "); myComposer.appendElementReference(buf, (RefElement) owner, isPackageIncluded); } else if (isPackageIncluded) { buf.append(" ").append("<code class=\"package\">").append("("); myComposer.appendQualifiedName(buf, owner); // buf.append(RefUtil.getPackageName(refElement)); buf.append(")").append(HTMLComposerImpl.CODE_CLOSING); } } }