Package org.supercsv.io
Interface ICsvListWriter
- All Superinterfaces:
AutoCloseable
,Closeable
,Flushable
,ICsvWriter
- All Known Implementing Classes:
CsvListWriter
Interface for writers that write to a List.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Writes a array of Objects as columns of a CSV file.void
Writes an array of strings as columns of a CSV file.void
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 org.supercsv.io.ICsvWriter
getLineNumber, getRowNumber, writeComment, writeHeader
-
Method Details
-
write
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 == 0IOException
- If an I/O error occursNullPointerException
- if columns is nullSuperCsvException
- if there was a general exception while writing- Since:
- 1.0
-
write
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 writeprocessors
- 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 == 0IOException
- If an I/O error occursNullPointerException
- if columns or processors is nullSuperCsvConstraintViolationException
- if a CellProcessor constraint failedSuperCsvException
- if there was a general exception while writing/processing- Since:
- 1.0
-
write
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 == 0IOException
- If an I/O error occursNullPointerException
- if columns is nullSuperCsvException
- if there was a general exception while writing- Since:
- 1.0
-
write
Writes an array of strings as columns of a CSV file.- Parameters:
columns
- the columns to write- Throws:
IllegalArgumentException
- if columns.length == 0IOException
- If an I/O error occursNullPointerException
- if columns is nullSuperCsvException
- if there was a general exception while writing- Since:
- 1.0
-