I don't think the number of validator instances matters. Maintenance of constraint validator instances is quite easy (leaving the more controversial constraints like Email, URL and SafeHtml out of the picture). Most of them we wrote once and never had to update. Is there no common base class to unify things? With JodaTime this was for example the case. Not sure what the new Java 8 classes look like though.
Just counted again, there are 14 types, 5 of them have a common base class.
We can also use Temporal which is the base class for all date/time types, and have only one validator with casting, but I'm not sure how clean this will be.
|