public final class IBANValidator extends Object implements javax.validation.ConstraintValidator<IBAN,CharSequence>
This routine is based on the ISO 7064 Mod 97,10 check digit caluclation routine.
The two check digit characters in a IBAN number are the third and fourth characters
in the code. For check digit calculation/validation the first four characters are moved
to the end of the code.
So CCDDnnnnnnn becomes nnnnnnnCCDD (where
CC is the country code and DD is the check digit). For
check digit calcualtion the check digit value should be set to zero (i.e.
CC00nnnnnnn in this example.
For further information see Wikipedia - IBAN number.
| Constructor and Description |
|---|
IBANValidator() |
| Modifier and Type | Method and Description |
|---|---|
void |
initialize(IBAN iban) |
boolean |
isValid(CharSequence code,
javax.validation.ConstraintValidatorContext context) |
public boolean isValid(CharSequence code, javax.validation.ConstraintValidatorContext context)
isValid in interface javax.validation.ConstraintValidator<IBAN,CharSequence>public void initialize(IBAN iban)
initialize in interface javax.validation.ConstraintValidator<IBAN,CharSequence>Copyright © 2010–2020 The Apache Software Foundation. All rights reserved.