@Status(stage=DEVELOPMENT, unitTests=PARTIAL) @Review(by="Kees Schotanus",at="2009-09-28") @Review(by="Kees Schotanus",at="2010-10-22",reason="Totally rewrote csv classes") public abstract class AbstractCsvFileWriter extends AbstractCsvWriter
AbstractCsvWriter.hasNextRow()
and AbstractCsv.getNextRow()
.Constructor and Description |
---|
AbstractCsvFileWriter(File file)
Constructs this AbstractCsvFileWriter that will write csv data to the
supplied file.
|
AbstractCsvFileWriter(File file,
Character columnSeparator)
Constructs this AbstractCsvFileWriter that will write csv data to the
supplied file and will use the supplied columnSeparator as a column
separator.
|
AbstractCsvFileWriter(File file,
Character columnSeparator,
String rowSeparator)
Constructs this AbstractCsvFileWriter that will write csv data to the supplied
file and will use the supplied columnSeparator as a column separator and
the supplied rowSeparator to separate the rows.
|
Modifier and Type | Method and Description |
---|---|
void |
writeCsvData()
Writes all the rows returned by
AbstractCsv.getNextRow() to the file
specified at construction time. |
void |
writeRow(String row)
Writes a single row of csv data.
|
hasNextRow
getColumnSeparator, getNextRow, getRowSeparator, setColumnSeparator, setRowSeparator
public AbstractCsvFileWriter(File file)
file
- The file to write the csv data to.NullPointerException
- When the supplied file is null.public AbstractCsvFileWriter(File file, Character columnSeparator)
file
- The file to write the csv data to.columnSeparator
- The separator that separates the different
columns.NullPointerException
- When either the supplied file or
columnSeparator is null.public AbstractCsvFileWriter(File file, Character columnSeparator, String rowSeparator)
file
- The file to write the csv data to.columnSeparator
- The separator that separates the different
columns.rowSeparator
- The separator that separates the different rows.
NullPointerException
- When either the supplied file,
columnSeparator or rowSeparator is null.public void writeCsvData()
AbstractCsv.getNextRow()
to the file
specified at construction time.writeCsvData
in class AbstractCsvWriter
CsvException
- When the csv data could not be written.public void writeRow(String row)
writeRow
in class AbstractCsvWriter
row
- The row to write.
Copyright © 2008–2018. All rights reserved.