Modernisation of LeProperty and GeProperty setter annotations
Description
The only remaining legacy validation annotations, used in application to setters, are LeProperty and GeProperty.
All current use of these annotations are in application to date properties, representing from/to date ranges.
These annotations are currently applicable only to methods, but should become applicable to fields as well.
It is not desired to deprecate them because the standard way of declaring validators is more verbose:
@LeProperty("endPeriod")
Date startPeriod;
@BeforeChange(@Handler(LePropertyValidator.class, str = @StrParam(name = "prop", value = "periodEnd")))
Date startPeriod;
-
[x] 1. Develop validator
LePropertyValidatorto be used as a standard BCE handler instead ofLeProperty. The actual implementation could reuseRangePropertyValidator. Currently, the validator for@LePropertyis instantiated inAbstractMetaPropertyFactoryasnew RangePropertyValidator(upperBoundaryProperties, false, dates). -
[x] 2. Develop validator
GePropertyValidatorto be used as a standard BCE handler instead ofGeProperty. The actual implementation could reuseRangePropertyValidator. Currently, the validator for@GePropertyis instantiated inAbstractMetaPropertyFactoryasnew RangePropertyValidator(lowerBoundaryProperties, true, dates). -
[x] 3. Make
@LePropertyand@GePropertyapplicable to fields and replace instantiation of corresponding validators inAbstractMetaPropertyFactoryto useLePropertyValidatorandGePropertyValidatorrespectively. -
[x] 4. Update code template
tgprop-from-and-tofor IntelliJ IDEA.
Expected outcome
Removal of the legacy setter-based approach to express constraints, achieving consistency in the way constraints are declared in domain models.