Package com.prowidesoftware.swift.io
Class RJEWriter
- java.lang.Object
-
- com.prowidesoftware.swift.io.AbstractWriter
-
- com.prowidesoftware.swift.io.RJEWriter
-
public class RJEWriter extends AbstractWriter
Helper API to write MT messages into RJE files.- Since:
- 7.8
- See Also:
AbstractWriter
-
-
Field Summary
-
Fields inherited from class com.prowidesoftware.swift.io.AbstractWriter
writer
-
-
Constructor Summary
Constructors Constructor Description RJEWriter(java.io.File file)
RJEWriter(java.io.File _file, java.nio.charset.Charset _charset)
Constructs aRJEWriter
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 aRJEWriter
to write content to the specified output stream using the specified charset.RJEWriter(java.io.Writer writer)
Constructs a RJEWriter to write content into a given Writer instance.RJEWriter(java.lang.String filename)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
setSplitChar(char c)
Overwrites the default standard split charRJEReader.SPLITCHAR
void
write(AbstractMT msg)
Writes the message into the internal writer in RJE formatstatic 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.-
Methods inherited from class com.prowidesoftware.swift.io.AbstractWriter
close, flush
-
-
-
-
Constructor Detail
-
RJEWriter
public RJEWriter(java.io.Writer writer)
Constructs a RJEWriter to write content into a given Writer instance.
-
RJEWriter
public RJEWriter(java.io.File file) throws java.io.FileNotFoundException
- Throws:
java.io.FileNotFoundException
-
RJEWriter
public RJEWriter(java.lang.String filename) throws java.io.FileNotFoundException
- Throws:
java.io.FileNotFoundException
-
RJEWriter
public RJEWriter(java.io.File _file, java.nio.charset.Charset _charset) throws java.io.FileNotFoundException
Constructs aRJEWriter
to write content into a file using the specified charset.- Parameters:
_file
- file to write to_charset
- charset- Throws:
java.io.FileNotFoundException
-
RJEWriter
public RJEWriter(java.io.OutputStream stream)
-
RJEWriter
public RJEWriter(java.io.OutputStream _stream, java.nio.charset.Charset _charset)
Constructs aRJEWriter
to write content to the specified output stream using the specified charset.- Parameters:
_stream
- stream to write to_charset
- charset
-
-
Method Detail
-
write
public static void write(AbstractMT msg, java.io.Writer writer) throws java.io.IOException
- Parameters:
msg
- message to write- Throws:
java.io.IOException
- if an I/O error occurs- See Also:
write(String, Writer)
-
write
public static void write(java.lang.String msg, java.io.Writer writer) throws java.io.IOException
Static implementation to write the message content into the parameter writer in RJE format.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.
- Parameters:
msg
- SWIFT MT content to write- Throws:
java.io.IOException
- if an I/O error occurs
-
write
public void write(java.lang.String msg) throws java.io.IOException
Writes the message content into the internal writer in RJE format.- Parameters:
msg
- SWIFT MT content to write- Throws:
java.io.IOException
- if an I/O error occurs
-
write
public void write(AbstractMT msg) throws java.io.IOException
Writes the message into the internal writer in RJE format- Parameters:
msg
- message to write- Throws:
java.io.IOException
- if an I/O error occurs
-
setSplitChar
public void setSplitChar(char c)
Overwrites the default standard split charRJEReader.SPLITCHAR
- Parameters:
c
- a character to use as message separator- Since:
- 7.9.7
-
-