Source:
public void generate() throws IOException, UnsupportedOperationException { JavaFileObject sourceFile = processingEnvironment.getFiler().createSourceFile(qualifiedGeneratedClassName); JavaWriter writer = new JavaWriter(new BufferedWriter(sourceFile.openWriter())); writer.setIndent(Constants.INDENT); writer.emitPackage(Constants.REALM_PACKAGE_NAME) .emitEmptyLine(); List<String> imports = new ArrayList<String>(IMPORTS); if (!metadata.getBacklinkFields().isEmpty()) { imports.add("io.realm.internal.UncheckedRow"); } writer.emitImports(imports) .emitEmptyLine(); writer.emitAnnotation("SuppressWarnings(\"all\")") .beginType( qualifiedGeneratedClassName, "class", EnumSet.of(Modifier.PUBLIC), qualifiedClassName, "RealmObjectProxy", interfaceName) .emitEmptyLine(); emitColumnInfoClass(writer); emitClassFields(writer); emitConstructor(writer); emitInjectContextMethod(writer); emitPersistedFieldAccessors(writer); emitBacklinkFieldAccessors(writer); emitCreateRealmObjectSchemaMethod(writer); emitValidateTableMethod(writer); emitGetTableNameMethod(writer); emitGetFieldNamesMethod(writer); emitCreateOrUpdateUsingJsonObject(writer); emitCreateUsingJsonStream(writer); emitCopyOrUpdateMethod(writer); emitCopyMethod(writer); emitInsertMethod(writer); emitInsertListMethod(writer); emitInsertOrUpdateMethod(writer); emitInsertOrUpdateListMethod(writer); emitCreateDetachedCopyMethod(writer); emitUpdateMethod(writer); emitToStringMethod(writer); emitRealmObjectProxyImplementation(writer); emitHashcodeMethod(writer); emitEqualsMethod(writer); writer.endType(); writer.close(); }

Target:
public void generate() throws IOException, UnsupportedOperationException { JavaFileObject sourceFile = processingEnvironment.getFiler().createSourceFile(qualifiedGeneratedClassName); JavaWriter writer = new JavaWriter(new BufferedWriter(sourceFile.openWriter())); writer.setIndent(Constants.INDENT); writer.emitPackage(Constants.REALM_PACKAGE_NAME) .emitEmptyLine(); List<String> imports = new ArrayList<String>(IMPORTS); if (!metadata.getBacklinkFields().isEmpty()) { imports.add("io.realm.internal.UncheckedRow"); } writer.emitImports(imports) .emitEmptyLine(); if (suppressWarnings) { writer.emitAnnotation("SuppressWarnings(\"all\")"); } writer .beginType( qualifiedGeneratedClassName, "class", EnumSet.of(Modifier.PUBLIC), qualifiedClassName, "RealmObjectProxy", interfaceName) .emitEmptyLine(); emitColumnInfoClass(writer); emitClassFields(writer); emitConstructor(writer); emitInjectContextMethod(writer); emitPersistedFieldAccessors(writer); emitBacklinkFieldAccessors(writer); emitCreateRealmObjectSchemaMethod(writer); emitValidateTableMethod(writer); emitGetTableNameMethod(writer); emitGetFieldNamesMethod(writer); emitCreateOrUpdateUsingJsonObject(writer); emitCreateUsingJsonStream(writer); emitCopyOrUpdateMethod(writer); emitCopyMethod(writer); emitInsertMethod(writer); emitInsertListMethod(writer); emitInsertOrUpdateMethod(writer); emitInsertOrUpdateListMethod(writer); emitCreateDetachedCopyMethod(writer); emitUpdateMethod(writer); emitToStringMethod(writer); emitRealmObjectProxyImplementation(writer); emitHashcodeMethod(writer); emitEqualsMethod(writer); writer.endType(); writer.close(); }