public class IBAN
extends java.lang.Object
IBAN iban = new IBAN("ES2153893489");
if (iban.isValid())
System.out.println("ok");
else
System.out.println("problem with iban: "+iban.getInvalidCause());
Constructor and Description |
---|
IBAN(java.lang.String iban)
Create an IBAN object with the given iban code.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getIban()
Get the IBAN
|
java.lang.String |
getInvalidCause()
Get a string with information about why the IBAN was found invalid
|
boolean |
isValid()
Completely validate an IBAN
Currently validation checks that the length is at least 5 chars:
(2 country code, 2 verifying digits, and 1 BBAN)
checks the country code to be valid an the BBAN to match the verifying digits
|
java.lang.String |
removeNonAlpha(java.lang.String iban) |
void |
setIban(java.lang.String iban)
Set the IBAN
|
java.lang.String |
translateChars(java.lang.StringBuffer bban)
Translate letters to numbers, also ignoring non alphanumeric characters
|
public IBAN(java.lang.String iban)
iban
- public java.lang.String getIban()
public java.lang.String getInvalidCause()
public boolean isValid()
true
if the IBAN is found to be valid and false
in other casejava.lang.IllegalStateException
- if iban is null
public java.lang.String removeNonAlpha(java.lang.String iban)
iban
- public void setIban(java.lang.String iban)
iban
- the IBAN to setpublic java.lang.String translateChars(java.lang.StringBuffer bban)
bban
-