public class IBANValidator
extends java.lang.Object
| Modifier and Type | Class | Description |
|---|---|---|
static class |
IBANValidator.Validator |
The validation class
|
| Modifier and Type | Field | Description |
|---|---|---|
static IBANValidator |
DEFAULT_IBAN_VALIDATOR |
The singleton instance which uses the default formats
|
| Constructor | Description |
|---|---|
IBANValidator() |
Create a default IBAN validator.
|
IBANValidator(IBANValidator.Validator[] formatMap) |
Create an IBAN validator from the specified map of IBAN formats.
|
| Modifier and Type | Method | Description |
|---|---|---|
IBANValidator.Validator[] |
getDefaultValidators() |
Gets a copy of the default Validators.
|
static IBANValidator |
getInstance() |
Return a singleton instance of the IBAN validator using the default formats
|
IBANValidator.Validator |
getValidator(java.lang.String code) |
Get the Validator for a given IBAN
|
boolean |
hasValidator(java.lang.String code) |
Does the class have the required validator?
|
boolean |
isValid(java.lang.String code) |
Validate an IBAN Code
|
IBANValidator.Validator |
setValidator(java.lang.String countryCode,
int length,
java.lang.String format) |
Installs a validator.
|
IBANValidator.Validator |
setValidator(IBANValidator.Validator validator) |
Installs a validator.
|
public static final IBANValidator DEFAULT_IBAN_VALIDATOR
public IBANValidator()
public IBANValidator(IBANValidator.Validator[] formatMap)
formatMap - map of IBAN formatspublic static IBANValidator getInstance()
public boolean isValid(java.lang.String code)
code - The value validation is being performed ontrue if the value is validpublic boolean hasValidator(java.lang.String code)
code - the code to checkpublic IBANValidator.Validator[] getDefaultValidators()
public IBANValidator.Validator getValidator(java.lang.String code)
code - a string starting with the ISO country code (e.g. an IBAN)null if there is not one registered.public IBANValidator.Validator setValidator(IBANValidator.Validator validator)
validator - the instance to install.null if there was nonejava.lang.IllegalStateException - if an attempt is made to modify the singleton validatorpublic IBANValidator.Validator setValidator(java.lang.String countryCode, int length, java.lang.String format)
countryCode - the country codelength - the length of the IBAN. Must be ≥ 8 and ≤ 32.
If the length is < 0, the validator is removed, and the format is not used.format - the format of the IBAN (as a regular expression)null if there was nonejava.lang.IllegalArgumentException - if there is a problemjava.lang.IllegalStateException - if an attempt is made to modify the singleton validatorCopyright © 2002–2018. All rights reserved.