public class REGONValidator extends PolishNumberValidator<REGON>
REGON
. Validates both 9 and 14 digits REGON numbers.Constructor and Description |
---|
REGONValidator() |
Modifier and Type | Method and Description |
---|---|
protected int[] |
getWeights(List<Integer> digits) |
void |
initialize(REGON constraintAnnotation)
Initializes the validator in preparation for
ConstraintValidator.isValid(Object, ConstraintValidatorContext) calls. |
isCheckDigitValid
extractDigit, initialize, isValid
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
isValid
public void initialize(REGON constraintAnnotation)
ConstraintValidator
ConstraintValidator.isValid(Object, ConstraintValidatorContext)
calls.
The constraint annotation for a given constraint declaration
is passed.
This method is guaranteed to be called before any use of this instance for validation.
The default implementation is a no-op.
constraintAnnotation
- annotation instance for a given constraint declarationprotected int[] getWeights(List<Integer> digits)
getWeights
in class PolishNumberValidator<REGON>
digits
- a list of digits to be verified. They are used to determine a size of REGON number - is it 9 or 14 digit numberCopyright © 2019 JBoss by Red Hat. All rights reserved.