public class ColumnQuoteMode extends Object implements QuoteMode
Constructor and Description |
---|
ColumnQuoteMode(boolean[] columnsToQuote)
Constructs a new ColumnQuoteMode that quotes columns if the element representing that column in the
supplied array is true.
|
ColumnQuoteMode(int... columnsToQuote)
Constructs a new ColumnQuoteMode that quotes columns by column number.
|
Modifier and Type | Method and Description |
---|---|
boolean |
quotesRequired(String csvColumn,
CsvContext context,
CsvPreference preference)
Determines whether surrounding quotes are mandatory in cases where the CSV column would not normally be quoted
(the data to be written doesn't contain special characters).
|
public ColumnQuoteMode(int... columnsToQuote)
columnsToQuote
- the column numbers to quotepublic ColumnQuoteMode(boolean[] columnsToQuote)
columnsToQuote
- array of booleans (one per CSV column) indicating whether each column should be quoted or notNullPointerException
- if columnsToQuote is nullpublic boolean quotesRequired(String csvColumn, CsvContext context, CsvPreference preference)
quotesRequired
in interface QuoteMode
csvColumn
- an element of a CSV filecontext
- the contextpreference
- the CSV preferencesCopyright © 2007–2015 Super CSV. All rights reserved.