Interface ICsvListWriter

All Superinterfaces:
AutoCloseable, Closeable, Flushable, ICsvWriter
All Known Implementing Classes:
CsvListWriter

public interface ICsvListWriter extends ICsvWriter
Interface for writers that write to a List.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    write(Object... columns)
    Writes a array of Objects as columns of a CSV file.
    void
    write(String... columns)
    Writes an array of strings as columns of a CSV file.
    void
    write(List<?> columns)
    Writes a List of Objects as columns of a CSV file.
    void
    write(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

    Methods inherited from interface org.supercsv.io.ICsvWriter

    getLineNumber, getRowNumber, writeComment, writeHeader
  • Method Details

    • write

      void write(List<?> columns) throws 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:
      IllegalArgumentException - if columns.size == 0
      IOException - If an I/O error occurs
      NullPointerException - if columns is null
      SuperCsvException - if there was a general exception while writing
      Since:
      1.0
    • write

      void write(List<?> columns, CellProcessor[] processors) throws 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:
      IllegalArgumentException - if columns.size == 0
      IOException - If an I/O error occurs
      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(Object... columns) throws 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:
      IllegalArgumentException - if columns.length == 0
      IOException - If an I/O error occurs
      NullPointerException - if columns is null
      SuperCsvException - if there was a general exception while writing
      Since:
      1.0
    • write

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