The Trinidad subclass of LengthValidator needs some work.
Changes I plan to make - feedback appreciated:

- The messages are copied from the LongRangeValidator, so
 we say "Enter a value greater than or equal to 5" instead
 of "Enter a value of 5 or more characters".  (I'll use the latter)

- If min and max are the same, we don't have a custom message,
 so you'd get something like "Enter a value between 5 and 5
 characters".  Looks silly.  So, in addition to
 LengthValidator.NOT_IN_RANGE, I'll add LengthValidator.EXACT.

- The override of Validate assumes the value is a Number!, and
 lots of Javadoc is cut-and-pasted from LongRangeValidator,
 it would seem...  Thankfully, there's an instanceof check,
 so no ClassCastExceptions but this code has to just be broken...

-- Adam

Reply via email to