Interface OutputWriter

    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      default void close()
      Closes output target.
      default void initialize()
      Makes preparations for writing output to an output target.
      String target()
      Returns a String describing the target to which the output is written (primarily for logging purposes).
      void write​(String output)
      Writes single piece of information to output target.
      void writeHeader​(String output)
      Writes the header (if available) to the output target.
      void writeNewLine()
      Generates a newline (if possible) in the output target.
    • Method Detail

      • target

        String target()
        Returns a String describing the target to which the output is written (primarily for logging purposes).
        Returns:
        a String describing the target to which the output is written to.
      • initialize

        default void initialize()
                         throws IOException
        Makes preparations for writing output to an output target. The default is empty and should be overridden by the implementation if an initialize() step is needed before actual data is written.
        Throws:
        IOException
      • close

        default void close()
                    throws IOException
        Closes output target. The default is empty and should be overridden by the implementation if a close() step is needed after the data is written (to cleanly close off the target opened during initialize()).
        Throws:
        IOException
      • write

        void write​(String output)
            throws IOException
        Writes single piece of information to output target.
        Parameters:
        output - the output to be written to the output target
        Throws:
        IOException
      • writeHeader

        void writeHeader​(String output)
                  throws IOException
        Writes the header (if available) to the output target.
        Parameters:
        output -
        Throws:
        IOException
      • writeNewLine

        void writeNewLine()
                   throws IOException
        Generates a newline (if possible) in the output target.
        Throws:
        IOException