boolean (StringBuilder buffer, boolean generatePrologue) { if (myElement instanceof PsiClass cls) { generateClassJavaDoc(buffer, cls, generatePrologue); } else if (myElement instanceof PsiMethod method) { generateMethodJavaDoc(buffer, method, generatePrologue); } else if (myElement instanceof PsiPatternVariable var) { generatePatternVariableJavaDoc(buffer, generatePrologue, var); } else if (myElement instanceof PsiParameter parameter) { generateMethodParameterJavaDoc(buffer, parameter, generatePrologue); } else if (myElement instanceof PsiField field) { generateFieldJavaDoc(buffer, field, generatePrologue); } else if (myElement instanceof PsiRecordComponent component) { generateRecordComponentJavaDoc(buffer, generatePrologue, component); } else if (myElement instanceof PsiVariable var) { generateVariableJavaDoc(buffer, var, generatePrologue); } else if (myElement instanceof PsiDirectory dir) { PsiPackage aPackage = JavaDirectoryService.getInstance().getPackage(dir); if (aPackage == null) return false; generatePackageJavaDoc(buffer, aPackage, generatePrologue); } else if (myElement instanceof PsiPackage pkg) { generatePackageJavaDoc(buffer, pkg, generatePrologue); } else if (myElement instanceof PsiJavaModule module) { generateModuleJavaDoc(buffer, module, generatePrologue); } else { return false; } return true; }