Various settings applying to the entire CSV file and BeanInstructions.
-
Optional Element Summary
Modifier and TypeOptional ElementDescriptionchar
All lines starting with this symbol (must be at the first encountered position) will be considered comments, which are ignored by the parser.char[]
The symbols all eligible as end-of-line markers.char
The symbol which escapes a quote character while inside a quoted string.Class
<? extends AbstractMapper> Determines the strategy to employ for mapping between CSV and Bean.char
The quote symbol is the sign on both sides of the field value.boolean
Sets whether or not quotes are written around the field values.char
The separator is the symbol between two fields.boolean
Ascertains that comment lines are skipped.boolean
Ascertains that empty lines are skipped.int
The column where the dynamic headers start.int
The point from where the lines must be read, including the structure (if applicable).boolean
States whether the first line will be used as a structure line.
-
Element Details
-
escape
char escapeThe symbol which escapes a quote character while inside a quoted string. By default a double quote (")- Returns:
- escape character
- Default:
'\"'
-
quote
char quoteThe quote symbol is the sign on both sides of the field value. By default this will be a double quote- Returns:
- quote symbol for a field
- Default:
'\"'
-
quotingEnabled
boolean quotingEnabledSets whether or not quotes are written around the field values. If enabled, the character set as the escape symbol will be disabled. If disabled, no quotes are written around the field values and the escape symbol is not escaped. This setting has no effect when reading CSV files, only when writing them.- Returns:
- whether or not to write quotes around field values
- Default:
true
-
separator
char separatorThe separator is the symbol between two fields. By default this will be a semi-colon- Returns:
- separator between two fields
- Default:
';'
-
endOfLine
char[] endOfLineThe symbols all eligible as end-of-line markers. By default \r and \n are both eol symbols- Returns:
- all the eligible eol symbols
- Default:
{'\r', '\n'}
-
comment
char commentAll lines starting with this symbol (must be at the first encountered position) will be considered comments, which are ignored by the parser.- Returns:
- comment symbol
- Default:
'#'
-
useHeader
boolean useHeaderStates whether the first line will be used as a structure line. If this is not the case, the mapping will be done based on column indexes.- Returns:
- whether to use the first line as a structure or not
- Default:
true
-
startRow
int startRowThe point from where the lines must be read, including the structure (if applicable). By default, this value is 1 and includes the header. Note that row counting starts at 1, not at 0, ie CSVeed is 1-based to be more aligned with the Excel user who receives the error report, not the developer.- Returns:
- the point from where lines must be converted, 1-based
- Default:
1
-
skipEmptyLines
boolean skipEmptyLinesAscertains that empty lines are skipped. If this value is false, empty lines will be parsed as single column rows. Default values is true.- Returns:
- whether empty files must be skipped
- Default:
true
-
skipCommentLines
boolean skipCommentLinesAscertains that comment lines are skipped. If this value is false, the comment marker is ignored. Normally, this method should not be needed. Use only if you want to have 100% certainty that lines identified as comment lines are never skipped. Default value is true.- Returns:
- whether comment lines (marked with a comment marker on the first position) must be skipped
- Default:
true
-
startIndexDynamicColumns
int startIndexDynamicColumnsThe column where the dynamic headers start. All columns following this column are automatically assumed to be dynamic also.- Returns:
- index where dynamic columns start
- Default:
0
-
mappingStrategy
Class<? extends AbstractMapper> mappingStrategyDetermines the strategy to employ for mapping between CSV and Bean. The default will be to map on the basis of the column index- Returns:
- the mapping strategy
- Default:
org.csveed.bean.ColumnIndexMapper.class
-