...
| Inhalt | ||
|---|---|---|
|
The Nuclet provides methods and rules for validating IBANs.
The following is checked:
| Version | Changes |
|---|---|
| 2.6 |
|
First, the definitions for the IBAN validation (IBAN registry) must be imported.
This is done via an CSV-Import:
Creating the CSV import (left) and successful import (right).
There are two ways to use the IBAN validation:
a) Call validation methods in your own Java classes
For this, the corresponding methods in the class org.nuclet.iban.IBANValidator can be called.
A complete validation is performed by calling the method
| Codeblock | ||
|---|---|---|
| ||
public static boolean validateIban(RuleContext context, String iban) |
which on success true returns and otherwise throws an IBANValidationExeption (inherits from BusinessException).
b) Use generic implementation
An already existing business object with a validatable IBAN field can be configured as an implementation of the generischen Businessobjekts Kontoverbindung from the IBAN Nuclet as follows:
Now, in the Server rule manager die Regel the rule "PruefeIBAN" als Insert-, Update- und/oder State-Change-Rule dem implementierenden Businessobjekt zugewiesen werdenmust be assigned to the implementing business object as an insert, update and/or state-change rule.
In the class IbanValidator the function exists
| Codeblock | ||
|---|---|---|
| ||
public static String formatiereIBAN(RuleContext context, String iban) throws BusinessException |
which first validates the IBAN and then, if successful, returns it formatted according to the standard DIN 5008 .
A rule ("PruefeUndFormatiereIBAN") is also available for this in the Server rule manager.
The supported country formats can be (de)activated separately in the IBAN registry.
If the validation is deactivated, the validation fails for IBANs with the corresponding country prefix.
By default, all supported formats are also activated
The IBAN validation supports the following country codes:
| AT | Austria |
| BE | Belgium |
| BG | Bulgaria |
| CY | Cyprus |
| CZ | Czech Republic |
| DK | Denmark |
| FO | Denmark |
| GL | Denmark |
| EE | Estonia |
| FI | Finland |
| FR | France |
| DE | Germany |
| GI | Gibraltar |
| GR | Greece |
| HU | Hungary |
| IS | Iceland |
| IE | Ireland |
| IT | Italy |
| LV | Latvia |
| LI | Liechtenstein (Principality) |
| LT | Lithuania |
| LU | Luxembourg |
| MT | Malta |
| MC | Monaco |
| NL | Netherlands |
| NO | Norway |
| PL | Poland |
| PT | Portugal |
| RO | Romania |
| SK | Slovak Republic |
| SI | Slovenia |
| ES | Spain |
| SE | Sweden |
| CH | Switzerland |
| GB | United Kingdom |
...