|
Currently, ignoreNonDigitCharacters() applies to the entire validated string, but it might make sense to apply it only to the interval specified via startIndex and endIndex. Otherwise, values containing separator characters couldn't be validated via @Mod11 (which can use non-digit characters as check digit), e.g. "123-456-789-X", where one would like to ignore the dashes but consider "X" as check digit.
Furthermore the values to be given for startIndex, endIndex and checkDigitPosition depend on the setting of ignoreNonDigitCharacters, in one case only digits need to be taken into account ("counted") when given the values, in the other case all characters of the validated string count. I think, generally using the latter would make using the constraints a bit simpler.
Finally, checkDigitPosition should be renamed into checkDigitIndex to be consistent with the other two options.
|