org.apache.bval.extras.constraints.checkdigit
Class IBANValidator

java.lang.Object
  extended by org.apache.bval.extras.constraints.checkdigit.IBANValidator
All Implemented Interfaces:
ConstraintValidator<IBAN,String>

public final class IBANValidator
extends Object
implements ConstraintValidator<IBAN,String>

IBAN (International Bank Account Number) Check Digit calculation/validation.

This rountine 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 Summary
IBANValidator()
           
 
Method Summary
 void initialize(IBAN iban)
          
 boolean isValid(String code, ConstraintValidatorContext context)
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IBANValidator

public IBANValidator()
Method Detail

isValid

public boolean isValid(String code,
                       ConstraintValidatorContext context)

Specified by:
isValid in interface ConstraintValidator<IBAN,String>

initialize

public void initialize(IBAN iban)

Specified by:
initialize in interface ConstraintValidator<IBAN,String>


Copyright © 2010-2014 The Apache Software Foundation. All Rights Reserved.