|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.prowidesoftware.swift.model.IBAN
public class IBAN
Utility class to validate IBAN codes. The IBAN consists of a ISO 3166-1 alpha-2 country code, followed by two check digits (represented by kk in the examples below), and up to thirty alphanumeric characters for the domestic bank account number, called the BBAN (Basic Bank Account Number).
IBAN iban = new IBAN("ES2153893489");
if (iban.isValid())
System.out.println("ok");
else
System.out.println("problem with iban: "+iban.getInvalidCause());
Constructor Summary | |
---|---|
IBAN(java.lang.String iban)
Create an IBAN object with the given iban code. |
Method Summary | |
---|---|
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 |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public IBAN(java.lang.String iban)
iban
- Method Detail |
---|
public java.lang.String getIban()
public void setIban(java.lang.String iban)
iban
- the IBAN to setpublic boolean isValid()
true
if the IBAN is found to be valid and false
in other case
java.lang.IllegalStateException
- if iban is null
public java.lang.String translateChars(java.lang.StringBuffer bban)
bban
-
public java.lang.String removeNonAlpha(java.lang.String iban)
iban
-
public java.lang.String getInvalidCause()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |