Class RJEWriter

    • Constructor Summary

      Constructors 
      Constructor 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.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 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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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 a RJEWriter 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 a RJEWriter 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 char RJEReader.SPLITCHAR
        Parameters:
        c - a character to use as message separator
        Since:
        7.9.7