The methods and static values provided by the Java classes have a similar name to the main API functions and values. The changes are:
API methods which access integer or string data use the return value of the function. For example BWIGetValue and BWIGetString would be called as:
long value = h.getValue(item); String s = h.getString(item); |
Provides access to the functions and values which do not need a handle. The init() method also resides within the BankWizardInt class. This is because it is Bank wizard that is being initialised and not the handle. All BankwizardInt methods are static so you can use the class name to call an instance.
BWIHandle h = new BWIHandle(); BankWizardInt.init(h); |
Accesses all functions and values which need a handle. When this is called, it internally calls the API function BWICreateHandle. The handle is provided with a finalize() method that calls BWIFree to release the resources stored in the core. However, because there is a limited supply of handles, your application should free them rather than rely upon the garbage collector.
BWIHandle h = new BWIHandle(); ... do task h.free(); |
Where cc is the ISO country code.
Supplies the condition and field values for the country. All values are static.
For example, the class for the UK is BWIUK and is used as follows:
BWIHandle h = new BWIHandle(); h.setValue(h.V_COUNTRY_CHECK,h.C_UK); h.setString(BWIUK.SORT_CODE,"010004"); h.setString(BWIUK.ACCOUNT_NO,"12345678"); h.check(); ... h.free(); |
This exception is thrown when an invalid handle is passed to a method which needs a valid handle. A handle can become invalid because:
A handle could become invalid if the same Java object is referenced by two variables and free is called on one of them.
BWIHandle h = new BWIHandle(); BWIHandle h2 = h; ... h2.free(); h.check(); /* Exception thrown here */ |
When implementing Bank Wizard, avoid referencing a handle by two variables. If you need to do this, allow the garbage collector to clean up. In most cases, take a copy so you can use it independently.
BWIHandle h = new BWIHandle(); BWIHandle h2 = new BWIHandle(); ... /* h2 is an exact but independent copy of h */ h2.copyHandle(h); ... h.free(); h2.check(); /* No exception */ |