Constructor and Description |
---|
AbstractReader(File file)
Constructs a reader to read messages from a file
|
AbstractReader(InputStream stream)
Constructs a reader to read messages from a stream
|
AbstractReader(Reader r)
Constructs a reader to read messages from a given Reader instance
|
AbstractReader(String string)
Constructs a reader to read messages from a string
|
Modifier and Type | Method and Description |
---|---|
Iterator<String> |
iterator() |
abstract String |
next() |
AbstractMT |
nextMT()
Reads the next raw content from the iterator and returns the message parsed into an MT.
|
SwiftMessage |
nextSwiftMessage()
Reads the next raw content from the iterator and returns the message parsed as a generic SwiftMessage.
|
void |
remove() |
protected Reader reader
public AbstractReader(Reader r)
public AbstractReader(String string)
IllegalArgumentException
- if string is null
public AbstractReader(InputStream stream)
IllegalArgumentException
- if stream is null
public AbstractReader(File file) throws FileNotFoundException
IllegalArgumentException
- if file is null
FileNotFoundException
public AbstractMT nextMT() throws IOException
IMPORTANT:
Since MTnnn model classes are implemented only for system and user-to-user messages
(categories 0 to 9) if an ACK/NAK (service id 21) message is found, the MT following
the system message is returned (not the ACK/NAK).
For other service messages (login, select, quit) this method will return null because
there is no MT representation to create.
If you need to deal with all type of messages (including service, system and user-to-user)
you can use nextSwiftMessage()
instead.
IOException
- if the message content cannot be parsed into an MTpublic SwiftMessage nextSwiftMessage() throws IOException
IOException
- if the message content cannot be parsed into a SwiftMessage