public class IBAN extends 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(String iban)
Create an IBAN object with the given iban code.
|
Modifier and Type | Method and Description |
---|---|
String |
getIban()
Get the IBAN
|
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
|
String |
removeNonAlpha(String iban) |
void |
setIban(String iban)
Set the IBAN
|
String |
translateChars(StringBuffer bban)
Deprecated.
|
String |
translateChars(StringBuilder bban)
Translate letters to numbers, also ignoring non alphanumeric characters
|
public IBAN(String iban)
iban
- public String getIban()
public void setIban(String iban)
iban
- the IBAN to setpublic boolean isValid()
true
if the IBAN is found to be valid and false
in other caseIllegalStateException
- if iban is null
@Deprecated @ProwideDeprecated(phase3=_2018) public String translateChars(StringBuffer bban)
translateChars(StringBuilder)
public String translateChars(StringBuilder bban)
bban
- public String removeNonAlpha(String iban)
iban
- public String getInvalidCause()