public class RJEWriter extends AbstractWriter
AbstractWriter
writer
Constructor and Description |
---|
RJEWriter(java.io.File file) |
RJEWriter(java.io.File _file,
java.nio.charset.Charset _charset)
Constructs a
RJEWriter to write content into a file using the specified charset. |
RJEWriter(java.io.OutputStream stream) |
RJEWriter(java.io.OutputStream _stream,
java.nio.charset.Charset _charset)
Constructs a
RJEWriter to write content to the specified output stream using the specified charset. |
RJEWriter(java.lang.String filename) |
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
java.io.FileNotFoundException
public RJEWriter(java.io.File _file, java.nio.charset.Charset _charset) throws java.io.FileNotFoundException
RJEWriter
to write content into a file using the specified charset._file
- file to write to_charset
- charsetjava.io.FileNotFoundException
public RJEWriter(java.io.OutputStream stream)
public RJEWriter(java.io.OutputStream _stream, java.nio.charset.Charset _charset)
RJEWriter
to write content to the specified output stream using the specified charset._stream
- stream to write to_charset
- charsetpublic 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