public CharSequence generateType(final JvmDeclaredType type, final GeneratorConfig config) { final ImportManager importManager = this.createImportManager(type); final TreeAppendable bodyAppendable = this.createAppendable(type, importManager, config); bodyAppendable.openScope(); this.assignThisAndSuper(bodyAppendable, type, config); this.generateBody(type, bodyAppendable, config); bodyAppendable.closeScope(); final TreeAppendable importAppendable = this.createAppendable(type, importManager, config); this.generateFileHeader(type, importAppendable, config); String _packageName = type.getPackageName(); boolean _tripleNotEquals = (_packageName != null); if (_tripleNotEquals) { importAppendable.append("package ").append(type.getPackageName()).append(";"); importAppendable.newLine().newLine(); } List<String> _imports = importManager.getImports(); for (final String i : _imports) { importAppendable.append("import ").append(i).append(";").newLine(); } boolean _isEmpty = importManager.getImports().isEmpty(); boolean _not = (!_isEmpty); if (_not) { importAppendable.newLine(); } importAppendable.append(bodyAppendable); return importAppendable; }