Class Exporter.ExporterAction<E>
java.lang.Object
org.nuiton.csv.Exporter.ExporterAction<E>
- Since:
- 3.0
- Author:
- Tony Chemit - chemit@codelutin.com
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final ExporterConfiguration<E> Exporter configuration.protected byte[]Current row to export as an array of bytes.protected intPosition to read in the current row array.Data to export.protected booleanIs the first row was consumed ?protected final intNumber of cells per row.protected final booleanWrite header ? -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedExporterAction(ExporterConfiguration<E> configuration, boolean writeHeader, Iterable<E> data) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddCellToRowBuilder(StringBuilder rowBuilder, int index, String formattedCell, String cellSeparator) voidexport(OutputStream outputStream) voidprotected static <E> Exporter.ExporterAction<E> of(ExporterConfiguration<E> configuration, Iterable<E> data, boolean writeHeader) protected byte[]protected voidprotected byte[]protected byte[]protected byte[]toCurrentRow(StringBuilder rowBuilder) toReader()
-
Field Details
-
dataIterator
-
writeHeader
protected final boolean writeHeaderWrite header ? -
configuration
Exporter configuration. -
nbCellsPerRow
protected final int nbCellsPerRowNumber of cells per row. -
firstRowConsumed
protected boolean firstRowConsumedIs the first row was consumed ? -
currentRow
protected byte[] currentRowCurrent row to export as an array of bytes. -
currentRowPosition
protected int currentRowPositionPosition to read in the current row array.
-
-
Constructor Details
-
ExporterAction
protected ExporterAction(ExporterConfiguration<E> configuration, boolean writeHeader, Iterable<E> data)
-
-
Method Details
-
of
protected static <E> Exporter.ExporterAction<E> of(ExporterConfiguration<E> configuration, Iterable<E> data, boolean writeHeader) -
export
- Throws:
IOException
-
export
- Throws:
IOException
-
toInputStream
-
toReader
-
readFirstRowOrGetCurrentRow
protected byte[] readFirstRowOrGetCurrentRow() -
readNextRow
protected byte[] readNextRow() -
readHeader
protected void readHeader() -
readRow
-
addCellToRowBuilder
protected void addCellToRowBuilder(StringBuilder rowBuilder, int index, String formattedCell, String cellSeparator) -
toCurrentRow
-