public class CsvConfiguration extends Object
Modifier and Type | Field and Description |
---|---|
static Charset |
DEFAULT_CHARSET
The default charset encoding.
|
static String |
DEFAULT_DATE_FORMAT
The default date format.
|
static String |
DEFAULT_DATE_TIME_FORMAT
The default date time format.
|
static String |
DEFAULT_FALSE_FORMAT
The default
false representation. |
static boolean |
DEFAULT_FORCE_CONSUME_HEADER
The default configuration whether forcibly consumes header cells even if header contents is invalid or not.
|
static List<String> |
DEFAULT_HEADER_CELLS
The default header cells (empty list).
|
static boolean |
DEFAULT_LINE_BREAK_IN_VALUE
The default configuration whether allows line breaks in value.
|
static char |
DEFAULT_SEPARATOR_CHAR
The default field separator character.
|
static String |
DEFAULT_TRUE_FORMAT
The default
true representation. |
Constructor and Description |
---|
CsvConfiguration(Charset charset,
List<String> headerCells,
String trueFormat,
String falseFormat,
String dateFormat,
String dateTimeFormat)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
Charset |
getCharset()
Returns the character set encoding name.
|
String |
getDateFormat()
The
Date format in SimpleDateFormat . |
String |
getDateTimeFormat()
The
DateTime format in SimpleDateFormat . |
String |
getFalseFormat()
The boolean
false format. |
int[] |
getForceQuoteColumns()
Returns column indices which quoting is always required.
|
List<String> |
getHeaderCells()
The header cell values.
|
char |
getSeparatorChar()
Returns the field separator character.
|
String |
getTrueFormat()
The boolean
true format. |
boolean |
isForceConsumeHeader()
Returns whether forcibly consumes header cells or not.
|
boolean |
isLineBreakInValue()
Returns whether allows line breaks in value.
|
void |
setForceConsumeHeader(boolean newValue)
Sets whether forcibly consumes header cells or not.
|
void |
setForceQuoteColumns(int... indices)
Sets column indices which quoting is always required.
|
void |
setLineBreakInValue(boolean allow)
Sets whether allows line breaks in value.
|
void |
setSeparatorChar(char separatorChar)
Sets the field separator character.
|
public static final Charset DEFAULT_CHARSET
getCharset()
public static final List<String> DEFAULT_HEADER_CELLS
getHeaderCells()
public static final String DEFAULT_TRUE_FORMAT
true
representation.getTrueFormat()
,
Constant Field Valuespublic static final String DEFAULT_FALSE_FORMAT
false
representation.getFalseFormat()
,
Constant Field Valuespublic static final String DEFAULT_DATE_FORMAT
getDateFormat()
,
Constant Field Valuespublic static final String DEFAULT_DATE_TIME_FORMAT
getDateTimeFormat()
,
Constant Field Valuespublic static final char DEFAULT_SEPARATOR_CHAR
getSeparatorChar()
,
Constant Field Valuespublic static final boolean DEFAULT_LINE_BREAK_IN_VALUE
isLineBreakInValue()
,
Constant Field Valuespublic static final boolean DEFAULT_FORCE_CONSUME_HEADER
isForceConsumeHeader()
,
Constant Field Valuespublic CsvConfiguration(Charset charset, List<String> headerCells, String trueFormat, String falseFormat, String dateFormat, String dateTimeFormat)
charset
- character set encoding nameheaderCells
- header cell values, or an empty list for no headertrueFormat
- the true
representationfalseFormat
- the false
representationdateFormat
- Date
format in SimpleDateFormat
dateTimeFormat
- DateTime
format in SimpleDateFormat
IllegalArgumentException
- if some parameters were null
public Charset getCharset()
public List<String> getHeaderCells()
public String getTrueFormat()
true
format.public String getFalseFormat()
false
format.public String getDateFormat()
Date
format in SimpleDateFormat
.public String getDateTimeFormat()
DateTime
format in SimpleDateFormat
.public boolean isLineBreakInValue()
true
if allow, otherwise false
public void setLineBreakInValue(boolean allow)
allow
- true
to allow, otherwise false
public char getSeparatorChar()
public void setSeparatorChar(char separatorChar)
separatorChar
- the separatorpublic boolean isForceConsumeHeader()
true
to forcibly consumes the header cell, otherwise false
public void setForceConsumeHeader(boolean newValue)
newValue
- true
to forcibly consumes the header cell, otherwise false
public int[] getForceQuoteColumns()
public void setForceQuoteColumns(int... indices)
indices
- the column indicesCopyright © 2011–2019 Asakusa Framework Team. All rights reserved.