Class IBANValidator
- java.lang.Object
-
- org.apache.bval.extras.constraints.checkdigit.IBANValidator
-
- All Implemented Interfaces:
jakarta.validation.ConstraintValidator<IBAN,CharSequence>
public final class IBANValidator extends Object implements jakarta.validation.ConstraintValidator<IBAN,CharSequence>
IBAN (International Bank Account Number) Check Digit calculation/validation.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
becomesnnnnnnnCCDD
(whereCC
is the country code andDD
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 Summary
Constructors Constructor Description IBANValidator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
initialize(IBAN iban)
boolean
isValid(CharSequence code, jakarta.validation.ConstraintValidatorContext context)
-
-
-
Method Detail
-
isValid
public boolean isValid(CharSequence code, jakarta.validation.ConstraintValidatorContext context)
- Specified by:
isValid
in interfacejakarta.validation.ConstraintValidator<IBAN,CharSequence>
-
initialize
public void initialize(IBAN iban)
- Specified by:
initialize
in interfacejakarta.validation.ConstraintValidator<IBAN,CharSequence>
-
-