public class CsvFieldWriter extends Object implements FieldWriter
FieldWriter for RFC4180 style CSV files.| Constructor and Description |
|---|
CsvFieldWriter(Writer writer,
LineSeparator lineSeparator,
char fieldSeparator,
char quoteCharacter,
boolean allowLineFeed,
QuoteStyle defaultQuoteStyle,
QuoteStyle headerQuoteStyle,
UnaryOperator<CharSequence> transformer)
Creates a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
putEndOfRecord()
Puts an end-of-record mark and starts writing the next record.
|
void |
putField(FieldOutput output)
Puts a next field into the current writing record.
|
public CsvFieldWriter(Writer writer, LineSeparator lineSeparator, char fieldSeparator, char quoteCharacter, boolean allowLineFeed, QuoteStyle defaultQuoteStyle, QuoteStyle headerQuoteStyle, UnaryOperator<CharSequence> transformer)
writer - the destination writerlineSeparator - the line separator kindfieldSeparator - the field separator characterquoteCharacter - the quote characterallowLineFeed - true to allow LF in field, otherwise falsedefaultQuoteStyle - the default quote styleheaderQuoteStyle - the quote style for headerstransformer - the output transformer (nullable)public void putField(FieldOutput output) throws IOException
FieldWriterputField in interface FieldWriteroutput - the field contentsIOException - if I/O error was occurred while writing the next fieldpublic void putEndOfRecord()
throws IOException
FieldWriterputEndOfRecord in interface FieldWriterIOException - if I/O error was occurred while writing the end-of-record markpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionCopyright © 2011–2018 Asakusa Framework Team. All rights reserved.