This is a core package that provides classes to hold the structure for all SWIFT messages.
It is basically a three level hierarchy representing the primary elements that defines a SWIFT message; the message itself, it's blocks, and the tag (or fields) inside each block. The object model is quite generic and loosely coupled to particular MT structures, that require minimal construction constrains.
SwiftMessage The top level object in the hierarchy is the SwiftMessage, which contains attributes to hold up to five SwiftBlock objects and optionally an arbitrary number of SwiftBlockUser (see below).
SwiftBlock Each block class is a subclass of SwiftBlock. There is a small hierarchy of different block classes, grouped by functionality. For example, in FIN messages, block 1 is fixed length a string, and block 4 is a set of tags. An abstract class hierarchy represents this block taxonomy and specific subclasses exist for each of the five possible SWIFT blocks.
SwiftValueBlock In the hierarchy the SwiftValueBlock is a container for blocks with fixed length string value. Its child classes implement then specific attributes for each field of the string value. For Block1 for example you have getters and setters for serviceId, applicationId, etc..
SwiftTagListBlock And SwiftTagListBlock is a container for blocks conformed by list of Tag. A tag is basically a pair of datums, the name of the tag (for example; "59", "13C", "23E") and a value. Generic getters are provided to obtain individual tags or lists containing filtered subsets of tags.
SwiftBlockUser SwiftBlockUser is not part of SWIFT standard, but seems to be common practice for users to append some locally defined blocks to annotate messages in an almost-compatible way (for example: add block 9 for some local information or block "S" for system reference). Contents of this block are opaque for WIFE, but they are preserved so applications can still have them available
The following class diagrams shows the described blocks hierarchy:

UnparsedTextList The UnparsedTextList attributed present in message, block and tag objects is a container for special portion of some particular messages, mostly system and service messages. For example, the original message appended to an ACK message, the retrieved message appended to block 4 in MT 021 (Retrieval Response), the messages appended to Tag 270 in MT 056 (LT History Report). The following class diagrams shows the complete objects composition of a SWIFT message, including the most relevant attributes:

Notice that for WIFE all field are simple name/value pairs into a Tag object. If you need to parse and retrieve components inside fields you can make use of "prowide" field parser as a complement. This field parser is also LGPL. With both libraries you can parse and retrieve field components with ease, for example:
SwiftMessage m = (new SwiftParser()).parse(fin); Field32A f = new Field32A(m.getBlock3().getTagValue("32A")); Calendar date = f.getComponent1AsCalendar(); BigDecimal amount = new BigDecimal(f.getComponent3AsNumber().doubleValue());
|