public interface CsvWriteParameters
The default parameters will write CSVs that follow these guidelines:
LineEnding
."Address, Street"
.\
.2001-02-03
.2001-02-03T04:05:06.007Z
.String
before being written (e.g. by using LocalDate.format(DateTimeFormatter)
).Modifier and Type | Field and Description |
---|---|
static char |
NO_ESCAPE_CHARACTER
Character that can be provided to
setEscape(char) if no escapes should be written before
individual values. |
static char |
NO_QUOTES_CHARACTER
Character that can be passed into
setQuote(char) if no quotes should be written around individual
values. |
Modifier and Type | Method and Description |
---|---|
CsvWriteParameters |
setEscape(char escape)
Sets the character used to escape special characters (e.g.
|
CsvWriteParameters |
setHeaders(List<String> headers)
Sets the CSV headers (i.e.
|
CsvWriteParameters |
setLineEnding(LineEnding lineEnding)
Sets the
LineEnding that separates individual rows. |
CsvWriteParameters |
setQuote(char quote)
Sets the character used to surround individual values.
|
CsvWriteParameters |
setSeparator(char separator)
Sets the character that separates values.
|
static final char NO_QUOTES_CHARACTER
setQuote(char)
if no quotes should be written around individual
values.static final char NO_ESCAPE_CHARACTER
setEscape(char)
if no escapes should be written before
individual values.CsvWriteParameters setHeaders(List<String> headers)
Not setting headers has the implication that certain methods that accept column names
(e.g. RowBuilder.setValueByName(String, Object)
) will throw exceptions.
headers
- a list of headers for the CSV. Cannot be null or contain null/duplicate values.CsvWriteParameters setSeparator(char separator)
','
.
For example, if the separator character is ','
, then when writing the values "ABC" and "DEF" the output
would be "ABC,DEF"
.
separator
- the separator charCsvWriteParameters setEscape(char escape)
'\'
.
During writes, this character will be written before any special character that is contained in an individual value.
escape
- the escape charCsvWriteParameters setQuote(char quote)
'"'
.
If no quotes should be written, this method can be called with NO_QUOTES_CHARACTER
.
quote
- the quote characterCsvWriteParameters setLineEnding(LineEnding lineEnding)
LineEnding
that separates individual rows. If not set, the line endings will default to
LineEnding.LF
.
During writes, this line ending will be appended to every row.
lineEnding
- the line ending. Cannot be null.Copyright © Veeva Systems 2017–2021. All rights reserved.