Class ModCheckBase
java.lang.Object
org.hibernate.validator.internal.constraintvalidators.hv.ModCheckBase
- Direct Known Subclasses:
LuhnCheckValidator,Mod10CheckValidator,Mod11CheckValidator,ModCheckValidator,PESELValidator,PolishNumberValidator
ModCheckBase contains all shared methods and options used by Mod Check Validators
http://en.wikipedia.org/wiki/Check_digit
- Author:
- George Gastaldi, Hardy Ferentschik, Victor Rezende dos Santos
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected intextractDigit(char value) Returns the numericintvalue of acharprotected voidinitialize(int startIndex, int endIndex, int checkDigitIndex, boolean ignoreNonDigitCharacters) abstract booleanisCheckDigitValid(List<Integer> digits, char checkDigit) booleanisValid(CharSequence value, ConstraintValidatorContext context)
-
Constructor Details
-
ModCheckBase
public ModCheckBase()
-
-
Method Details
-
isValid
-
isCheckDigitValid
-
initialize
protected void initialize(int startIndex, int endIndex, int checkDigitIndex, boolean ignoreNonDigitCharacters) -
extractDigit
Returns the numericintvalue of achar- Parameters:
value- the inputcharto be parsed- Returns:
- the numeric
intvalue represented by the character. - Throws:
NumberFormatException- in case character is not a digit
-