Class SwiftStatementReader
The SwiftStatementReader reads one or more MT-940 or MT-942 SWIFT messages from a SwiftReader source.
Inheritance
Inherited Members
Namespace: Subsembly.Swift
Assembly: Subsembly.Sepa.dll
Syntax
public class SwiftStatementReader
Constructors
SwiftStatementReader(SwiftReader, Int32)
Creates a SwiftStatementReader that will read SWIFT fields from the given SwiftReader.
Declaration
public SwiftStatementReader(SwiftReader aSwiftReader, int nMT)
Parameters
Type | Name | Description |
---|---|---|
SwiftReader | aSwiftReader | SwiftReader that provides the input data as a stream of SWIFT fields. This input will be processed as a MT-940 or MT-942 SWIFT message. |
System.Int32 | nMT | This parameter selects whether the input will be processed as a MT-940 or MT-942 SWIFT message. The value 940 selects MT-940 processing, the value 942 selects MT-942 processing. The special value zero can be used for a most flexible processing of any kind of SWIFT statement. The value 999 can be used to process either MT-940 or MT-942. Other values are not allowed. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | The parameter aSwiftReader was |
System.ArgumentOutOfRangeException | The given message type parameter nMT was neither of 940, 942, 999, or 0. |
Properties
Field
The most recently read SWIFT field.
Declaration
public SwiftField Field { get; }
Property Value
Type | Description |
---|---|
SwiftField |
MT
The SWIFT message type.
Declaration
public int MT { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
Remarks
Initially this is the value passed to the ctor. If the value 999 was passed to the ctor, then this will change to 940 or 942 during reading of the data, as soon as the appropriate type was determined. If the value 0 was passed to the ctor, then this will always be 0, too.
RunningBalance
The running balance.
Declaration
public SwiftBalance RunningBalance { get; }
Property Value
Type | Description |
---|---|
SwiftBalance |
State
The current state of this SwiftStatementReader.
Declaration
public SwiftStatementReaderState State { get; }
Property Value
Type | Description |
---|---|
SwiftStatementReaderState |
StatementLine
The complete parsed statement line from the most recently read SWIFT fields 61 and 86.
Declaration
public SwiftStatementLine StatementLine { get; }
Property Value
Type | Description |
---|---|
SwiftStatementLine |
SwiftReader
The SwiftReader that was passed to the constructor.
Declaration
public SwiftReader SwiftReader { get; }
Property Value
Type | Description |
---|---|
SwiftReader |
Methods
ReadField()
Reads and processes the next SWIFT field according to the current State.
Declaration
public SwiftStatementReaderState ReadField()
Returns
Type | Description |
---|---|
SwiftStatementReaderState | Returns the new State that resulted from processing the SWIFT field. |
Remarks
If a Statement Line field (field 61) is encountered, then the optional subsequent Information to Account Owner field (field 86) is also read by this method. Both fields are then processed as if it were a single field, providing the combined parsed result through the StatementLine property.