public class RJEWriter extends AbstractWriter
AbstractWriter
writer
Constructor and Description |
---|
RJEWriter(java.io.File file)
Constructs a RJEWriter to write content into a file.
|
RJEWriter(java.io.OutputStream stream)
Constructs a RJEWriter to write content into a given stream.
|
RJEWriter(java.lang.String filename)
Constructs a RJEWriter to write content into a file.
|
RJEWriter(java.io.Writer writer)
Constructs a RJEWriter to write content into a given Writer instance.
|
Modifier and Type | Method and Description |
---|---|
void |
setSplitChar(char c)
Overwrites the default standard split char
RJEReader.SPLITCHAR |
void |
write(AbstractMT msg)
Writes the message into the internal writer in RJE format
|
static void |
write(AbstractMT msg,
java.io.Writer writer) |
void |
write(java.lang.String msg)
Writes the message content into the internal writer in RJE format.
|
static void |
write(java.lang.String msg,
java.io.Writer writer)
Static implementation to write the message content into the parameter writer in RJE format.
|
close, flush
public RJEWriter(java.io.Writer writer)
public RJEWriter(java.io.File file) throws java.io.FileNotFoundException
java.io.FileNotFoundException
public RJEWriter(java.lang.String filename) throws java.io.FileNotFoundException
filename
- file to createjava.io.FileNotFoundException
public RJEWriter(java.io.OutputStream stream)
public static void write(AbstractMT msg, java.io.Writer writer) throws java.io.IOException
msg
- message to writejava.io.IOException
- if an I/O error occurswrite(String, Writer)
public static void write(java.lang.String msg, java.io.Writer writer) throws java.io.IOException
IMPORTANT: this method will always append a trailing CRLF and $ at the end which in some platforms can be rejected as an invalid RJE file. For a more compliant version use the non static implementation of the write calls, to ensure the split separator is present only between messages but not after the last one. Also notice this method implementation cannot use custom split separator chars.
msg
- SWIFT MT content to writejava.io.IOException
- if an I/O error occurspublic void write(java.lang.String msg) throws java.io.IOException
msg
- SWIFT MT content to writejava.io.IOException
- if an I/O error occurspublic void write(AbstractMT msg) throws java.io.IOException
msg
- message to writejava.io.IOException
- if an I/O error occurspublic void setSplitChar(char c)
RJEReader.SPLITCHAR
c
- a character to use as message separator