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 false
defaultQuoteStyle
- the default quote styleheaderQuoteStyle
- the quote style for headerstransformer
- the output transformer (nullable)public void putField(FieldOutput output) throws IOException
FieldWriter
putField
in interface FieldWriter
output
- the field contentsIOException
- if I/O error was occurred while writing the next fieldpublic void putEndOfRecord() throws IOException
FieldWriter
putEndOfRecord
in interface FieldWriter
IOException
- if I/O error was occurred while writing the end-of-record markpublic void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException
Copyright © 2011–2019 Asakusa Framework Team. All rights reserved.