void (final RefEntity refElement, @NotNull StringBuilder buf) { if (refElement instanceof RefJavaElement) { String modifier = ((RefJavaElement)refElement).getAccessModifier(); if (!modifier.equals(PsiModifier.PACKAGE_LOCAL)) { buf.append(modifier); buf.append(HTMLComposerImpl.NBSP); } } refElement.accept(new RefJavaVisitor() { @Override public void visitClass(@NotNull RefClass refClass) { if (refClass.isStatic()) { buf.append(AnalysisBundle.message("inspection.export.results.static")); buf.append(HTMLComposerImpl.NBSP); } appendClassOrInterface(buf, refClass, false); buf.append(HTMLComposerImpl.NBSP).append(HTMLComposerImpl.B_OPENING).append(HTMLComposerImpl.CODE_OPENING); final String name = refClass.getName(); buf.append(refClass.isSyntheticJSP() ? XmlStringUtil.escapeString(name) : name); buf.append(HTMLComposerImpl.CODE_CLOSING).append(HTMLComposerImpl.B_CLOSING); } @Override public void visitField(@NotNull RefField field) { PsiField psiField = (PsiField)field.getUastElement().getJavaPsi(); if (psiField != null) { if (field.isStatic()) { buf.append(AnalysisBundle.message("inspection.export.results.static")); buf.append(HTMLComposerImpl.NBSP); } buf.append(AnalysisBundle.message("inspection.export.results.field")); buf.append(HTMLComposerImpl.NBSP).append(HTMLComposerImpl.CODE_OPENING); buf.append(XmlStringUtil.escapeString(psiField.getType().getPresentableText())); buf.append(HTMLComposerImpl.NBSP).append(HTMLComposerImpl.B_OPENING); buf.append(psiField.getName()); buf.append(HTMLComposerImpl.B_CLOSING).append(HTMLComposerImpl.CODE_CLOSING); } } @Override public void visitMethod(@NotNull RefMethod method) { UMethod uMethod = method.getUastElement(); if (uMethod == null) return; PsiMethod psiMethod = uMethod.getJavaPsi(); PsiType returnType = psiMethod.getReturnType(); if (method.isStatic()) { buf.append(AnalysisBundle.message("inspection.export.results.static")); buf.append(HTMLComposerImpl.NBSP); } else if (method.isAbstract()) { buf.append(AnalysisBundle.message("inspection.export.results.abstract")); buf.append(HTMLComposerImpl.NBSP); } buf.append(method.isConstructor() ? AnalysisBundle.message("inspection.export.results.constructor") : AnalysisBundle.message("inspection.export.results.method")); buf.append(HTMLComposerImpl.NBSP).append(HTMLComposerImpl.CODE_OPENING); if (returnType != null) { buf.append(XmlStringUtil.escapeString(returnType.getPresentableText())); buf.append(HTMLComposerImpl.NBSP); } buf.append(HTMLComposerImpl.B_OPENING); buf.append(psiMethod.getName()); buf.append(HTMLComposerImpl.B_CLOSING); appendMethodParameters(buf, psiMethod, true); buf.append(HTMLComposerImpl.CODE_CLOSING); } @Override public void visitFile(@NotNull RefFile file) { final PsiFile psiFile = file.getPsiElement(); buf.append(HTMLComposerImpl.B_OPENING); buf.append(psiFile.getName()); buf.append(HTMLComposerImpl.B_CLOSING); } }); }