Source:
public boolean generate(ModuleMetaData moduleMetaData) { Element enclosingElement = classType.getEnclosingElement(); if (!enclosingElement.getKind().equals(ElementKind.PACKAGE)) { Utils.error("The RealmClass annotation does not support nested classes.", classType); return false; } TypeElement parentElement = (TypeElement) Utils.getSuperClass(classType); if (!parentElement.toString().equals("java.lang.Object") && !parentElement.toString().equals("io.realm.RealmObject")) { Utils.error("Valid model classes must either extend RealmObject or implement RealmModel.", classType); return false; } PackageElement packageElement = (PackageElement) enclosingElement; packageName = packageElement.getQualifiedName().toString(); String qualifiedClassName = packageName + "." + javaClassName; NameConverter moduleClassNameFormatter = moduleMetaData.getClassNameFormatter(qualifiedClassName); defaultFieldNameFormatter = moduleMetaData.getFieldNameFormatter(qualifiedClassName); RealmClass realmClassAnnotation = classType.getAnnotation(RealmClass.class); if (!realmClassAnnotation.name().equals("")) { internalClassName = realmClassAnnotation.name(); } else { internalClassName = moduleClassNameFormatter.convert(javaClassName); } if (realmClassAnnotation.fieldNamingPolicy() != RealmNamingPolicy.NO_POLICY) { defaultFieldNameFormatter = Utils.getNameFormatter(realmClassAnnotation.fieldNamingPolicy()); } if (!categorizeClassElements()) { return false; } if (!checkCollectionTypes()) { return false; } if (!checkReferenceTypes()) { return false; } if (!checkDefaultConstructor()) { return false; } if (!checkForFinalFields()) { return false; } if (!checkForVolatileFields()) { return false; } return true; }

Target:
public boolean generate(ModuleMetaData moduleMetaData) { Element enclosingElement = classType.getEnclosingElement(); if (!enclosingElement.getKind().equals(ElementKind.PACKAGE)) { Utils.error("The RealmClass annotation does not support nested classes.", classType); return false; } TypeElement parentElement = (TypeElement) Utils.getSuperClass(classType); if (!parentElement.toString().equals("java.lang.Object") && !parentElement.toString().equals("io.realm.RealmObject")) { Utils.error("Valid model classes must either extend RealmObject or implement RealmModel.", classType); return false; } PackageElement packageElement = (PackageElement) enclosingElement; packageName = packageElement.getQualifiedName().toString(); String qualifiedClassName = packageName + "." + javaClassName; NameConverter moduleClassNameFormatter = moduleMetaData.getClassNameFormatter(qualifiedClassName); defaultFieldNameFormatter = moduleMetaData.getFieldNameFormatter(qualifiedClassName); RealmClass realmClassAnnotation = classType.getAnnotation(RealmClass.class); if (!realmClassAnnotation.name().equals("")) { internalClassName = realmClassAnnotation.name(); } else { internalClassName = moduleClassNameFormatter.convert(javaClassName); } if (internalClassName.length() > MAX_CLASSNAME_LENGTH) { Utils.error(String.format(Locale.US, "Internal class name is too long. Class '%s' " + "is converted to '%s', which is longer than the maximum allowed of %d characters", javaClassName, internalClassName, 57)); return false; } if (realmClassAnnotation.fieldNamingPolicy() != RealmNamingPolicy.NO_POLICY) { defaultFieldNameFormatter = Utils.getNameFormatter(realmClassAnnotation.fieldNamingPolicy()); } if (!categorizeClassElements()) { return false; } if (!checkCollectionTypes()) { return false; } if (!checkReferenceTypes()) { return false; } if (!checkDefaultConstructor()) { return false; } if (!checkForFinalFields()) { return false; } if (!checkForVolatileFields()) { return false; } return true; }