public class CSVParserWriter extends AbstractCSVWriter
Modifier and Type | Field and Description |
---|---|
protected ICSVParser |
parser |
exception, lineEnd, resultService, writer
DEFAULT_ESCAPE_CHARACTER, DEFAULT_LINE_END, DEFAULT_QUOTE_CHARACTER, DEFAULT_SEPARATOR, INITIAL_STRING_SIZE, NO_ESCAPE_CHARACTER, NO_QUOTE_CHARACTER, RFC4180_LINE_END
Constructor and Description |
---|
CSVParserWriter(Writer writer,
ICSVParser parser,
String lineEnd)
Constructor for the CSVParserWriter.
|
Modifier and Type | Method and Description |
---|---|
protected void |
writeNext(String[] nextLine,
boolean applyQuotesToAll,
Appendable appendable)
Writes the next line to the file.
|
checkError, close, flush, getException, resetError, resultService, setResultService, writeAll, writeAll, writeColumnNames, writeNext
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
flushQuietly, writeAll, writeAll, writeAll, writeAll, writeAll, writeNext
protected final ICSVParser parser
public CSVParserWriter(Writer writer, ICSVParser parser, String lineEnd)
writer
- - The writer to an underlying CSV source.parser
- - ICSVParser to convert the String array to csv formatted string.lineEnd
- - Desired line end String (either "\n" or "\r\n").protected void writeNext(String[] nextLine, boolean applyQuotesToAll, Appendable appendable) throws IOException
AbstractCSVWriter
writeNext
in class AbstractCSVWriter
nextLine
- a string array with each comma-separated element as a separate
entry.applyQuotesToAll
- true if all values are to be quoted. false applies quotes only
to values which contain the separator, escape, quote or new line characters.appendable
- Appendable used as buffer.IOException
- Exceptions thrown by the writer supplied to CSVWriter.Copyright © 2005–2023. All rights reserved.