writer
.emitStatement("%s result = %s.%s(%s)", pojoTypeDeclaration, factoryClass, factoryMethod.getName(), arguments);
}
} else {
if ( factoryMethod == null) {
ArgumentListM constructorArguments = properties.filterOutPropertiesWritableViaConstructorParameter(builderType);
StringBuilder arguments = new StringBuilder();
for (PropertyM prop : constructorArguments.sortByPosition().getPropertyList()) {
writer
.emitStatement("%s _%s = !%s && %s!=null?%s.build():%s",
writer.compressType(prop.getPropertyType().getGenericTypeDeclaration()),
prop.getConstructorParameter().getName(),
prop.getIsSetFieldName(),
prop.getBuilderFieldName(),
prop.getBuilderFieldName(),
prop.getValueFieldName()
);
if ( arguments.length()>0) {
arguments.append(", ");
}
arguments.append(String.format("_%s", prop.getConstructorParameter().getName()));
}
writer
.emitStatement("%s result = new %s(%s)", pojoTypeDeclaration, pojoTypeDeclaration, arguments.toString());
} else {
ArgumentListM constructorArguments = properties.filterOutPropertiesWritableViaFactoryMethodParameter(builderType);
StringBuilder arguments = new StringBuilder();
for (PropertyM prop : constructorArguments.sortByPosition().getPropertyList()) {
writer
.emitStatement("%s _%s = !%s && %s!=null?%s.build():%s",
writer.compressType(prop.getPropertyType().getGenericType()),
prop.getFactoryMethodParameter().getName(),
prop.getIsSetFieldName(),