PackageGenerator
PackageGenerator copied to clipboard
Export validation rule methods from generated classes?
Two generated validation methods (union, list and array rules) have been added to the generated classes:
-
union:
validate{parameterName}ForUnionConstraintsFrom{setterMethodName} -
list, array:
validate{parameterName}ArrayValuesFrom{setterMethodName} -
choice, array:
validate{parameterName}ForChoiceConstraintsFrom{setterMethodName}
Wouldn't it be better to extract them from the geenerated classes to the PackageBase project into a limited number of generic validation methods?
This way, it would be easier to implement new validation rules without having to update the generated classes nor the generator's validation rules.