Source:
<code>public JDefinedClass apply(String nodeName, JsonNode node, JDefinedClass jclass, Schema schema) { String propertyName = ruleFactory.getNameHelper().getPropertyName(nodeName, node); JType propertyType = ruleFactory.getSchemaRule().apply(nodeName, node, jclass, schema); boolean isIncludeGetters = ruleFactory.getGenerationConfig().isIncludeGetters(); boolean isIncludeSetters = ruleFactory.getGenerationConfig().isIncludeSetters(); node = resolveRefs(node, schema); int accessModifier = isIncludeGetters || isIncludeSetters ? JMod.PRIVATE : JMod.PUBLIC; JFieldVar field = jclass.field(accessModifier, propertyType, propertyName); propertyAnnotations(nodeName, node, schema, field); formatAnnotation(field, jclass, node); ruleFactory.getAnnotator().propertyField(field, jclass, nodeName, node); if (isIncludeGetters) { <START> JMethod getter = addGetter(jclass, field, nodeName, node, isRequired(nodeName, node, schema), usesOptional(nodeName, node, schema)); <END> ruleFactory.getAnnotator().propertyGetter(getter, jclass, nodeName); propertyAnnotations(nodeName, node, schema, getter); } if (isIncludeSetters) { JMethod setter = addSetter(jclass, field, nodeName, node); ruleFactory.getAnnotator().propertySetter(setter, jclass, nodeName); propertyAnnotations(nodeName, node, schema, setter); } if (ruleFactory.getGenerationConfig().isGenerateBuilders()) { addBuilder(jclass, field); } if (node.has("pattern")) { ruleFactory.getPatternRule().apply(nodeName, node.get("pattern"), field, schema); } ruleFactory.getDefaultRule().apply(nodeName, node.get("default"), field, schema); ruleFactory.getMinimumMaximumRule().apply(nodeName, node, field, schema); ruleFactory.getMinItemsMaxItemsRule().apply(nodeName, node, field, schema); ruleFactory.getMinLengthMaxLengthRule().apply(nodeName, node, field, schema); if (isObject(node) || isArray(node)) { ruleFactory.getValidRule().apply(nodeName, node, field, schema); } return jclass; }</code><technical_language>name usesOptional useOptional throughout? I this scans better</technical_language>

Target:
public JDefinedClass apply(String nodeName, JsonNode node, JDefinedClass jclass, Schema schema) { String propertyName = ruleFactory.getNameHelper().getPropertyName(nodeName, node); JType propertyType = ruleFactory.getSchemaRule().apply(nodeName, node, jclass, schema); boolean isIncludeGetters = ruleFactory.getGenerationConfig().isIncludeGetters(); boolean isIncludeSetters = ruleFactory.getGenerationConfig().isIncludeSetters(); node = resolveRefs(node, schema); int accessModifier = isIncludeGetters || isIncludeSetters ? JMod.PRIVATE : JMod.PUBLIC; JFieldVar field = jclass.field(accessModifier, propertyType, propertyName); propertyAnnotations(nodeName, node, schema, field); formatAnnotation(field, jclass, node); ruleFactory.getAnnotator().propertyField(field, jclass, nodeName, node); if (isIncludeGetters) { JMethod getter = addGetter(jclass, field, nodeName, node, isRequired(nodeName, node, schema), useOptional(nodeName, node, schema)); ruleFactory.getAnnotator().propertyGetter(getter, jclass, nodeName); propertyAnnotations(nodeName, node, schema, getter); } if (isIncludeSetters) { JMethod setter = addSetter(jclass, field, nodeName, node); ruleFactory.getAnnotator().propertySetter(setter, jclass, nodeName); propertyAnnotations(nodeName, node, schema, setter); } if (ruleFactory.getGenerationConfig().isGenerateBuilders()) { addBuilder(jclass, field); } if (node.has("pattern")) { ruleFactory.getPatternRule().apply(nodeName, node.get("pattern"), field, schema); } ruleFactory.getDefaultRule().apply(nodeName, node.get("default"), field, schema); ruleFactory.getMinimumMaximumRule().apply(nodeName, node, field, schema); ruleFactory.getMinItemsMaxItemsRule().apply(nodeName, node, field, schema); ruleFactory.getMinLengthMaxLengthRule().apply(nodeName, node, field, schema); if (isObject(node) || isArray(node)) { ruleFactory.getValidRule().apply(nodeName, node, field, schema); } return jclass; }