void (StringBuilder text, PsiClass typeDefinition) { if (typeDefinition instanceof GrEnumTypeDefinition) { final GrEnumConstant[] enumConstants = ((GrEnumTypeDefinition)typeDefinition).getEnumConstants(); for (GrEnumConstant constant : enumConstants) { classItemGenerator.writeEnumConstant(text, constant); text.append(','); } if (enumConstants.length > 0) { //text.removeFromTheEnd(1).append(";\n"); text.delete(text.length() - 1, text.length()); } text.append(";\n"); } writeAllMethods(text, classItemGenerator.collectMethods(typeDefinition), typeDefinition); if (typeDefinition instanceof GrTypeDefinition) { for (GrMembersDeclaration declaration : ((GrTypeDefinition)typeDefinition).getMemberDeclarations()) { if (declaration instanceof GrVariableDeclaration) { classItemGenerator.writeVariableDeclarations(text, (GrVariableDeclaration)declaration); } } for (PsiClass inner : typeDefinition.getInnerClasses()) { writeTypeDefinition(text, inner, false, false); text.append('\n'); } } classItemGenerator.writePostponed(text, typeDefinition); }