
@Generated(value="org.jomc.tools.SourceFileProcessor 1.5", comments="See http://www.jomc.org/jomc/1.5/jomc-tools-1.5") public final class IBAN extends Object implements CharSequence, Comparable<IBAN>, Formattable, Serializable
The IBAN structure is defined in ISO 13616-1 and consists of a two-letter ISO 3166-1 country code, followed by two check digits and up to thirty alphanumeric characters for a BBAN (Basic Bank Account Number) which has a fixed length per country and, included within it, a bank identifier with a fixed position and a fixed length per country. The check digits are calculated based on the scheme defined in ISO/IEC 7064 (MOD97-10). The Society for Worldwide Interbank Financial Telecommunication SCRL, SWIFT, has been designated by the ISO Technical Management Board to act as the Registration Authority for ISO 13616. Nationally-agreed, ISO 13616-compliant IBAN formats are submitted to the registration authority exclusively by the National Standards Body or the National Central Bank of the country. For further information see the IBAN REGISTRY. An updated version of the document may be found at SWIFT.
| Modifier and Type | Field and Description |
|---|---|
static int |
MAX_CHARACTERS
Maximum number of characters of an
IBAN. |
| Modifier and Type | Method and Description |
|---|---|
Appendable |
append(IbanFormat format,
Appendable appendable)
Formats an IBAN and appends the resulting text to a given
Appendable. |
char |
charAt(int index)
Returns the
char value at the specified index. |
int |
compareTo(IBAN o)
Compares this object with the specified object for order.
|
boolean |
equals(Object o)
Indicates whether some other object is equal to this one.
|
void |
formatTo(Formatter formatter,
int flags,
int width,
int precision)
Formats the object using the provided
Formatter. |
String |
getBankIdentifier()
Gets the bank identifier part of the BBAN of the IBAN.
|
String |
getBranchIdentifier()
Gets the branch identifier part of the BBAN of the IBAN.
|
String |
getCountryCode()
Gets the two-letter ISO 3166-1 country code of the IBAN.
|
static String[] |
getCountryCodes()
Gets an array holding two-letter ISO 3166-1 country codes of all countries that have implemented the IBAN
standard.
|
int |
hashCode()
Gets the hash code value of the object.
|
static boolean |
isIbanAlphabet(char c)
Checks a given character to belong to the IBAN alphabet.
|
boolean |
isSepaCountry()
Gets a flag indicating Single Euro Payments Area membership of the country of the IBAN.
|
int |
length()
Returns the length of this character sequence.
|
static IBAN |
parse(String text)
Parses text from the beginning of the given string to produce an
IBAN instance. |
static IBAN |
parse(String text,
ParsePosition pos)
Parses text from a string to produce an
IBAN instance. |
static IBAN |
parse(String countryCode,
String bban)
Parses text from a BBAN string to produce an
IBAN instance. |
static boolean |
peekIban(String text)
Parses text from a string to peek at a national
IBAN format. |
CharSequence |
subSequence(int start,
int end)
Returns a new
CharSequence that is a subsequence of this sequence. |
String |
toString()
Gets a string representation of the object.
|
String |
toString(IbanFormat format)
Formats an IBAN to produce a string.
|
static IBAN |
valueOf(String text)
Parses text from the beginning of the given string to produce an
IBAN instance. |
public static final int MAX_CHARACTERS
IBAN.public static String[] getCountryCodes()
public String getCountryCode()
getCountryCodes()public boolean isSepaCountry()
true, if the country of the IBAN is a member of the Single Euro Payments Area;
false, else.public String getBankIdentifier()
public String getBranchIdentifier()
null.public static IBAN parse(String countryCode, String bban) throws IbanSyntaxException
IBAN instance.countryCode - The two-letter ISO 3166-1 country code of the IBAN to create.bban - A string to parse BBAN characters from.NullPointerException - if countryCode or bban is null.IllegalArgumentException - if the country denoted by countryCode has not implemented the IBAN
standard, that is, countryCode is not contained in the array returned by method getCountryCodes.IbanSyntaxException - if the parse fails or the length of bban is invalid.getCountryCodes()public static IBAN parse(String text, ParsePosition pos) throws IbanCheckDigitsException
IBAN instance.
The method attempts to parse text starting at the index given by pos. If parsing succeeds, then the
index of pos is updated to the index after the last character used (parsing does not necessarily use all
characters up to the end of the string), and the parsed value is returned. The updated pos can be used to
indicate the starting point for the next call to this method.
text - A string to parse IBAN characters from.pos - A ParsePosition object with index and error index information as described above.null, if the parse fails.NullPointerException - if text or pos is null.IbanCheckDigitsException - if check digits validation of the parsed value fails.public static IBAN parse(String text) throws IbanSyntaxException, IbanCheckDigitsException
IBAN instance.
Unlike the parse(String, ParsePosition) method this method throws an IbanSyntaxException if
text cannot be parsed or is of invalid length.
text - A string to parse IBAN characters from.NullPointerException - if text is null.IbanSyntaxException - if the parse fails or the length of text is invalid.IbanCheckDigitsException - if check digits validation of the parsed value fails.valueOf(java.lang.String)public static IBAN valueOf(String text)
IBAN instance.
Unlike the parse(String) method this method throws an IllegalArgumentException if
text cannot be parsed, is of invalid length or check digits validation fails.
text - A string to parse IBAN characters from.NullPointerException - if text is null.IllegalArgumentException - if the parse fails, the length of text is invalid or if check digits
validation of the parsed value fails.parse(java.lang.String)public static boolean isIbanAlphabet(char c)
c - The character to check.true if c is a character of the IBAN alphabet; false, else.public static boolean peekIban(String text) throws IbanCheckDigitsException
IBAN format.
This method peeks at the given string to test whether it denotes a possibly valid national IBAN format.
text - A string to peek at.true, if text denotes a (possibly partially) valid national IBAN format; false,
if text does not denote a valid national IBAN format.NullPointerException - if text is null.IbanCheckDigitsException - if check digits validation fails.public Appendable append(IbanFormat format, Appendable appendable) throws IOException
Appendable.format - The format to use.appendable - The Appendable to append the formatted IBAN to.appendable.NullPointerException - if format or appendable is null.IOException - if appending fails.public String toString(IbanFormat format)
format - The format to use.NullPointerException - if format is null.public void formatTo(Formatter formatter, int flags, int width, int precision)
Formatter.
This method uses the ELECTRONIC format by default. The PRINT format can be used by specifying
the alternate form flag (#) in a format specifier.
formatTo in interface Formattableformatter - The Formatter.flags - The flags to modify the output format.width - The minimum number of characters to be written to the output.precision - The maximum number of characters to be written to the output.IllegalFormatFlagsException - if the UPPERCASE flag is set.public int length()
The length is the number of 16-bit chars in the sequence.
length in interface CharSequencechars in this sequence.public char charAt(int index)
char value at the specified index.
An index ranges from zero to length() - 1. The first char value of the sequence is at index
zero, the next at index one, and so on, as for array indexing.
If the char value specified by the index is a surrogate, the surrogate value is returned.
charAt in interface CharSequenceindex - The index of the char value to return.char value at index.IndexOutOfBoundsException - if index is negative or not less than the length of the character
sequence.length()public CharSequence subSequence(int start, int end)
CharSequence that is a subsequence of this sequence.
The subsequence starts with the char value at the specified index and ends with the char value
at index end - 1. The length (in chars) of the returned sequence is end - start, so if
start == end then an empty sequence is returned.
subSequence in interface CharSequencestart - The start index, inclusive.end - The end index, exclusive.start up to end -1.IndexOutOfBoundsException - if start or end are negative, if end is greater than
the length of the character sequence, or if start is greater than end.public int hashCode()
public String toString()
toString in interface CharSequencetoString in class Objectpublic int compareTo(IBAN o)
IBAN comparison respects the national IBAN formats when comparing IBANs of the same country. Any country codes and check digits are ignored.
compareTo in interface Comparable<IBAN>o - The Object to be compared.NullPointerException - if o is null.Copyright © 2013 jDTAUS. All rights reserved.