Interface ICsvListWriter

  • All Superinterfaces:
    java.lang.AutoCloseable, java.io.Closeable, java.io.Flushable, ICsvWriter
    All Known Implementing Classes:
    CsvListWriter

    public interface ICsvListWriter
    extends ICsvWriter
    Interface for writers that write to a List.
    Author:
    Kasper B. Graversen, James Bassett
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void write​(java.lang.Object... columns)
      Writes a array of Objects as columns of a CSV file.
      void write​(java.lang.String... columns)
      Writes an array of strings as columns of a CSV file.
      void write​(java.util.List<?> columns)
      Writes a List of Objects as columns of a CSV file.
      void write​(java.util.List<?> columns, CellProcessor[] processors)
      Writes a List of Objects as columns of a CSV file, performing any necessary processing beforehand.
      • Methods inherited from interface java.io.Closeable

        close
      • Methods inherited from interface java.io.Flushable

        flush
    • Method Detail

      • write

        void write​(java.util.List<?> columns)
            throws java.io.IOException
        Writes a List of Objects as columns of a CSV file. toString() will be called on each element prior to writing.
        Parameters:
        columns - the columns to write
        Throws:
        java.lang.IllegalArgumentException - if columns.size == 0
        java.io.IOException - If an I/O error occurs
        java.lang.NullPointerException - if columns is null
        SuperCsvException - if there was a general exception while writing
        Since:
        1.0
      • write

        void write​(java.util.List<?> columns,
                   CellProcessor[] processors)
            throws java.io.IOException
        Writes a List of Objects as columns of a CSV file, performing any necessary processing beforehand. toString() will be called on each (processed) element prior to writing.
        Parameters:
        columns - the columns to write
        processors - an array of CellProcessors used to further process data before it is written (each element in the processors array corresponds with a CSV column - the number of processors should match the number of columns). A null entry indicates no further processing is required (the value returned by toString() will be written as the column value).
        Throws:
        java.lang.IllegalArgumentException - if columns.size == 0
        java.io.IOException - If an I/O error occurs
        java.lang.NullPointerException - if columns or processors is null
        SuperCsvConstraintViolationException - if a CellProcessor constraint failed
        SuperCsvException - if there was a general exception while writing/processing
        Since:
        1.0
      • write

        void write​(java.lang.Object... columns)
            throws java.io.IOException
        Writes a array of Objects as columns of a CSV file. toString() will be called on each element prior to writing.
        Parameters:
        columns - the columns to write
        Throws:
        java.lang.IllegalArgumentException - if columns.length == 0
        java.io.IOException - If an I/O error occurs
        java.lang.NullPointerException - if columns is null
        SuperCsvException - if there was a general exception while writing
        Since:
        1.0
      • write

        void write​(java.lang.String... columns)
            throws java.io.IOException
        Writes an array of strings as columns of a CSV file.
        Parameters:
        columns - the columns to write
        Throws:
        java.lang.IllegalArgumentException - if columns.length == 0
        java.io.IOException - If an I/O error occurs
        java.lang.NullPointerException - if columns is null
        SuperCsvException - if there was a general exception while writing
        Since:
        1.0