public class CsvParserSettings extends CommonParserSettings<CsvFormat>
CsvParser)
In addition to the configuration options provided by CommonParserSettings, the CSVParserSettings include:
When reading, if the parser does not read any character from the input, and the input is within quotes, the empty is used instead of an empty string
CsvParser,
CsvFormat,
CommonParserSettingsheaderExtractionEnabled| Constructor and Description |
|---|
CsvParserSettings() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addConfiguration(Map<String,Object> out) |
CsvParserSettings |
clone()
Clones this configuration object.
|
CsvParserSettings |
clone(boolean clearInputSpecificSettings)
Clones this configuration object to reuse user-provided settings.
|
protected CsvFormat |
createDefaultFormat()
Returns the default CsvFormat configured to handle CSV inputs compliant to the RFC4180 standard.
|
void |
detectFormatAutomatically()
Convenience method to turn on all format detection features in a single method call, namely:
setDelimiterDetectionEnabled(boolean, char[])
setQuoteDetectionEnabled(boolean)
CommonParserSettings.setLineSeparatorDetectionEnabled(boolean)
|
CsvParserSettings |
detectFormatAutomatically(char... delimitersForDetection)
Convenience method to turn on all format detection features in a single method call, namely:
setDelimiterDetectionEnabled(boolean, char[])
setQuoteDetectionEnabled(boolean)
CommonParserSettings.setLineSeparatorDetectionEnabled(boolean)
|
char[] |
getDelimitersForDetection()
Returns the sequence of possible delimiters for detection when
isDelimiterDetectionEnabled() evaluates
to true, in order of priority. |
String |
getEmptyValue()
Returns the String representation of an empty value (defaults to null)
|
int |
getFormatDetectorRowSampleCount()
Returns the number of sample rows used in the CSV format auto-detection process (defaults to 20)
|
boolean |
getIgnoreLeadingWhitespacesInQuotes()
Returns whether or not leading whitespaces from quoted values should be skipped (defaults to false)
Note: if
keepQuotes evaluates to true, values won't be trimmed. |
boolean |
getIgnoreTrailingWhitespacesInQuotes()
Returns whether or not trailing whitespaces from within quoted values should be skipped (defaults to false)
Note: if
keepQuotes evaluates to true, values won't be trimmed. |
boolean |
getKeepQuotes()
Flag indicating whether the parser should keep enclosing quote characters in the values parsed from the input.
|
UnescapedQuoteHandling |
getUnescapedQuoteHandling()
Returns the method of handling values with unescaped quotes.
|
boolean |
isDelimiterDetectionEnabled()
Returns a flag indicating whether the parser should analyze the input to discover the column delimiter character.
|
boolean |
isEscapeUnquotedValues()
Indicates whether escape sequences should be processed in unquoted values.
|
boolean |
isKeepEscapeSequences()
Indicates whether the parser should keep any escape sequences if they are present in the input (i.e.
|
boolean |
isNormalizeLineEndingsWithinQuotes()
Flag indicating whether the parser should replace line separators, specified in
Format.getLineSeparator()
by the normalized line separator character specified in Format.getNormalizedNewline(), even on quoted values. |
boolean |
isParseUnescapedQuotes()
Deprecated.
use
getUnescapedQuoteHandling() instead. The configuration returned by getUnescapedQuoteHandling() will override this
setting if not null. |
boolean |
isParseUnescapedQuotesUntilDelimiter()
Deprecated.
use
getUnescapedQuoteHandling() instead. The configuration returned by getUnescapedQuoteHandling() will override this
setting if not null. |
boolean |
isQuoteDetectionEnabled()
Returns a flag indicating whether the parser should analyze the input to discover the quote character.
|
protected CharAppender |
newCharAppender()
Returns an instance of CharAppender with the configured limit of maximum characters per column and the default value used to represent an empty value
(when the String parsed from the input, within quotes, is empty)
|
CsvParserSettings |
setAutoConfigurationEnabled(boolean autoConfigurationEnabled)
Indicates whether this settings object can automatically derive configuration options.
|
void |
setDelimiterDetectionEnabled(boolean separatorDetectionEnabled)
Configures the parser to analyze the input before parsing to discover the column delimiter character.
|
CsvParserSettings |
setDelimiterDetectionEnabled(boolean separatorDetectionEnabled,
char... delimitersForDetection)
Configures the parser to analyze the input before parsing to discover the column delimiter character.
|
CsvParserSettings |
setEmptyValue(String emptyValue)
Sets the String representation of an empty value (defaults to null)
|
CsvParserSettings |
setErrorContentLength(int errorContentLength)
Configures the parser/writer to limit the length of displayed contents being parsed/written in the exception message when an error occurs.
|
CsvParserSettings |
setEscapeUnquotedValues(boolean escapeUnquotedValues)
Configures the parser to process escape sequences in unquoted values.
|
CsvParserSettings |
setFormat(CsvFormat format)
Defines the format of the file to be parsed/written (returns the format's defaults).
|
void |
setFormatDetectorRowSampleCount(int formatDetectorRowSampleCount)
Updates the number of sample rows used in the CSV format auto-detection process (defaults to 20)
|
CsvParserSettings |
setHeaders(String... headers)
Defines the field names in the input/output, in the sequence they occur (defaults to null).
|
CsvParserSettings |
setHeadersDerivedFromClass(Class<?> headerSourceClass,
String... headers)
Defines the field names in the input/output derived from a given class with
Parsed annotated attributes/methods. |
CsvParserSettings |
setIgnoreLeadingWhitespaces(boolean ignoreLeadingWhitespaces)
Defines whether or not leading whitespaces from values being read/written should be skipped (defaults to true)
|
CsvParserSettings |
setIgnoreLeadingWhitespacesInQuotes(boolean ignoreLeadingWhitespacesInQuotes)
Defines whether or not leading whitespaces from quoted values should be skipped (defaults to false)
Note: if
keepQuotes evaluates to true, values won't be trimmed. |
CsvParserSettings |
setIgnoreTrailingWhitespaces(boolean ignoreTrailingWhitespaces)
Defines whether or not trailing whitespaces from values being read/written should be skipped (defaults to true)
|
CsvParserSettings |
setIgnoreTrailingWhitespacesInQuotes(boolean ignoreTrailingWhitespacesInQuotes)
Defines whether or not trailing whitespaces from quoted values should be skipped (defaults to false)
Note: if
keepQuotes evaluates to true, values won't be trimmed. |
CsvParserSettings |
setKeepEscapeSequences(boolean keepEscapeSequences)
Configures the parser to keep any escape sequences if they are present in the input (i.e.
|
CsvParserSettings |
setKeepQuotes(boolean keepQuotes)
Configures the parser to keep enclosing quote characters in the values parsed from the input.
|
CsvParserSettings |
setMaxCharsPerColumn(int maxCharsPerColumn)
Defines the maximum number of characters allowed for any given value being written/read.
|
CsvParserSettings |
setMaxColumns(int maxColumns)
Defines a hard limit of how many columns a record can have (defaults to 512).
|
CsvParserSettings |
setNormalizeLineEndingsWithinQuotes(boolean normalizeLineEndingsWithinQuotes)
Configures the parser to replace line separators, specified in
Format.getLineSeparator()
by the normalized line separator character specified in Format.getNormalizedNewline(), even on quoted values. |
CsvParserSettings |
setNullValue(String emptyValue)
Sets the String representation of a null value (defaults to null)
|
CsvParserSettings |
setParseUnescapedQuotes(boolean parseUnescapedQuotes)
Deprecated.
use
setUnescapedQuoteHandling(UnescapedQuoteHandling) instead. The configuration returned by getUnescapedQuoteHandling()
will override this setting if not null. |
CsvParserSettings |
setParseUnescapedQuotesUntilDelimiter(boolean parseUnescapedQuotesUntilDelimiter)
Deprecated.
use
setUnescapedQuoteHandling(UnescapedQuoteHandling) instead. The configuration returned by getUnescapedQuoteHandling()
will override this setting if not null. |
CsvParserSettings |
setProcessorErrorHandler(ProcessorErrorHandler<? extends Context> processorErrorHandler)
Defines a custom error handler to capture and handle errors that might happen while processing records with a
Processor
or a RowWriterProcessor (i.e. |
CsvParserSettings |
setQuoteDetectionEnabled(boolean quoteDetectionEnabled)
Configures the parser to analyze the input before parsing to discover the quote character.
|
CsvParserSettings |
setRowProcessorErrorHandler(RowProcessorErrorHandler rowProcessorErrorHandler)
Deprecated.
Use the
setProcessorErrorHandler(ProcessorErrorHandler) method as it allows format-specific error handlers to be built to work with different implementations of Context.
Implementations based on RowProcessorErrorHandler allow only parsers who provide a ParsingContext to be used. |
CsvParserSettings |
setSkipBitsAsWhitespace(boolean skipBitsAsWhitespace)
Configures the parser to skip bit values as whitespace.
|
CsvParserSettings |
setSkipEmptyLines(boolean skipEmptyLines)
Defines whether or not empty lines should be ignored (defaults to true)
|
CsvParserSettings |
setUnescapedQuoteHandling(UnescapedQuoteHandling unescapedQuoteHandling)
Configures the handling of values with unescaped quotes.
|
CsvParserSettings |
trimQuotedValues(boolean trim)
Configures the parser to trim any whitespaces around values extracted from within quotes.
|
addInputAnalysisProcess, clearInputSpecificSettings, configureFromAnnotations, getInputAnalysisProcesses, getInputBufferSize, getNumberOfRecordsToRead, getNumberOfRowsToSkip, getProcessor, getReadInputOnSeparateThread, getRowProcessor, isAutoClosingEnabled, isBlankCommentCollectionEnabled, isColumnReorderingEnabled, isCommentCollectionEnabled, isCommentProcessingEnabled, isHeaderExtractionEnabled, isLineSeparatorDetectionEnabled, newCharInputReader, setAutoClosingEnabled, setColumnReorderingEnabled, setCommentCollectionEnabled, setCommentCollectionEnabled, setCommentProcessingEnabled, setHeaderExtractionEnabled, setInputBufferSize, setLineSeparatorDetectionEnabled, setNumberOfRecordsToRead, setNumberOfRowsToSkip, setProcessor, setReadInputOnSeparateThread, setRowProcessorexcludeFields, excludeFields, excludeIndexes, getErrorContentLength, getFormat, getHeaders, getIgnoreLeadingWhitespaces, getIgnoreTrailingWhitespaces, getMaxCharsPerColumn, getMaxColumns, getNullValue, getProcessorErrorHandler, getRowProcessorErrorHandler, getSkipBitsAsWhitespace, getSkipEmptyLines, getWhitespaceRangeStart, isAutoConfigurationEnabled, isProcessorErrorHandlerDefined, selectFields, selectFields, selectIndexes, toString, trimValuespublic String getEmptyValue()
When reading, if the parser does not read any character from the input, and the input is within quotes, the empty is used instead of an empty string
public CsvParserSettings setEmptyValue(String emptyValue)
When reading, if the parser does not read any character from the input, and the input is within quotes, the empty is used instead of an empty string
emptyValue - the String representation of an empty valueCsvParserSettings instanceprotected CharAppender newCharAppender()
This overrides the parent's version because the CSV parser does not rely on the appender to identify null values, but on the other hand, the appender is required to identify empty values.
newCharAppender in class CommonParserSettings<CsvFormat>protected CsvFormat createDefaultFormat()
createDefaultFormat in class CommonSettings<CsvFormat>@Deprecated public boolean isParseUnescapedQuotes()
getUnescapedQuoteHandling() instead. The configuration returned by getUnescapedQuoteHandling() will override this
setting if not null.true.@Deprecated public CsvParserSettings setParseUnescapedQuotes(boolean parseUnescapedQuotes)
setUnescapedQuoteHandling(UnescapedQuoteHandling) instead. The configuration returned by getUnescapedQuoteHandling()
will override this setting if not null.true, the parser will parse the quote normally as part of the value.
If set the false, a TextParsingException will be thrown. Defaults to true.parseUnescapedQuotes - indicates whether or not the CSV parser should accept unescaped quotes inside quoted values.@Deprecated public CsvParserSettings setParseUnescapedQuotesUntilDelimiter(boolean parseUnescapedQuotesUntilDelimiter)
setUnescapedQuoteHandling(UnescapedQuoteHandling) instead. The configuration returned by getUnescapedQuoteHandling()
will override this setting if not null.true)parseUnescapedQuotesUntilDelimiter - a flag indicating that the parser should stop accumulating values when a field delimiter character is
found when parsing unquoted and unescaped values.@Deprecated public boolean isParseUnescapedQuotesUntilDelimiter()
getUnescapedQuoteHandling() instead. The configuration returned by getUnescapedQuoteHandling() will override this
setting if not null.true)public boolean isEscapeUnquotedValues()
false.
By default, this is disabled and if the input is A""B,C, the resulting value will be
[A""B] and [C] (i.e. the content is read as-is). However, if the parser is configured
to process escape sequences in unquoted values, the result will be [A"B] and [C]
public CsvParserSettings setEscapeUnquotedValues(boolean escapeUnquotedValues)
false.
By default, this is disabled and if the input is A""B,C, the resulting value will be
[A""B] and [C] (i.e. the content is read as-is). However, if the parser is configured
to process escape sequences in unquoted values, the result will be [A"B] and [C]
escapeUnquotedValues - a flag indicating whether escape sequences should be processed in unquoted valuesCsvParserSettings instancepublic final boolean isKeepEscapeSequences()
"" won't be replaced by a single double quote ").
This is disabled by default
public final CsvParserSettings setKeepEscapeSequences(boolean keepEscapeSequences)
""
won't be replaced by a single double quote ").
This is disabled by default
keepEscapeSequences - the flag indicating whether escape sequences should be kept (and not replaced) by the parser.CsvParserSettings instancepublic final boolean isDelimiterDetectionEnabled()
Note that the detection process is not guaranteed to discover the correct column delimiter. In this case the delimiter provided by CsvFormat.getDelimiter() will be used
public final void setDelimiterDetectionEnabled(boolean separatorDetectionEnabled)
Note that the detection process is not guaranteed to discover the correct column delimiter.
The first character in the list of delimiters allowed for detection will be used, if available, otherwise
the delimiter returned by CsvFormat.getDelimiter() will be used.
separatorDetectionEnabled - the flag to enable/disable discovery of the column delimiter character.
to true, in order of priority.public final CsvParserSettings setDelimiterDetectionEnabled(boolean separatorDetectionEnabled, char... delimitersForDetection)
Note that the detection process is not guaranteed to discover the correct column delimiter.
The first character in the list of delimiters allowed for detection will be used, if available, otherwise
the delimiter returned by CsvFormat.getDelimiter() will be used.
separatorDetectionEnabled - the flag to enable/disable discovery of the column delimiter character.delimitersForDetection - possible delimiters for detection when isDelimiterDetectionEnabled() evaluates
to true, in order of priority.public final boolean isQuoteDetectionEnabled()
Note that the detection process is not guaranteed to discover the correct quote & escape.
In this case the characters provided by CsvFormat.getQuote() and CsvFormat.getQuoteEscape() will be used
public final CsvParserSettings setQuoteDetectionEnabled(boolean quoteDetectionEnabled)
Note that the detection process is not guaranteed to discover the correct quote & escape.
In this case the characters provided by CsvFormat.getQuote() and CsvFormat.getQuoteEscape() will be used
quoteDetectionEnabled - the flag to enable/disable discovery of the quote character. The quote escape will also be detected as part of this process.CsvParserSettings instancepublic final void detectFormatAutomatically()
public final CsvParserSettings detectFormatAutomatically(char... delimitersForDetection)
delimitersForDetection - possible delimiters for detection, in order of priority.CsvParserSettings instancepublic boolean isNormalizeLineEndingsWithinQuotes()
Format.getLineSeparator()
by the normalized line separator character specified in Format.getNormalizedNewline(), even on quoted values.
This is enabled by default and is used to ensure data be read on any platform without introducing unwanted blank lines.
For example, consider the quoted value "Line1 \r\n Line2". If this is parsed using "\r\n" as
the line separator sequence, and the normalized new line is set to '\n' (the default), the output will be:
[Line1 \n Line2]
However, if the value is meant to be kept untouched, and the original line separator should be maintained, set
the normalizeLineEndingsWithinQuotes to false. This will make the parser read the value as-is, producing:
[Line1 \r\n Line2]true if line separators in quoted values will be normalized, false otherwisepublic CsvParserSettings setNormalizeLineEndingsWithinQuotes(boolean normalizeLineEndingsWithinQuotes)
Format.getLineSeparator()
by the normalized line separator character specified in Format.getNormalizedNewline(), even on quoted values.
This is enabled by default and is used to ensure data be read on any platform without introducing unwanted blank lines.
For example, consider the quoted value "Line1 \r\n Line2". If this is parsed using "\r\n" as
the line separator sequence, and the normalized new line is set to '\n' (the default), the output will be:
[Line1 \n Line2]
However, if the value is meant to be kept untouched, and the original line separator should be maintained, set
the normalizeLineEndingsWithinQuotes to false. This will make the parser read the value as-is, producing:
[Line1 \r\n Line2]normalizeLineEndingsWithinQuotes - flag indicating whether line separators in quoted values should be replaced by
the the character specified in Format.getNormalizedNewline() .CsvParserSettings instancepublic CsvParserSettings setUnescapedQuoteHandling(UnescapedQuoteHandling unescapedQuoteHandling)
null, for backward compatibility with isParseUnescapedQuotes() and isParseUnescapedQuotesUntilDelimiter().
If set to a non-null value, this setting will override the configuration of isParseUnescapedQuotes() and isParseUnescapedQuotesUntilDelimiter().unescapedQuoteHandling - the handling method to be used when unescaped quotes are found in the input.CsvParserSettings instancepublic UnescapedQuoteHandling getUnescapedQuoteHandling()
null, for backward compatibility with isParseUnescapedQuotes() and isParseUnescapedQuotesUntilDelimiter()
If set to a non-null value, this setting will override the configuration of isParseUnescapedQuotes() and isParseUnescapedQuotesUntilDelimiter().null if not set.public boolean getKeepQuotes()
Defaults to false
public CsvParserSettings setKeepQuotes(boolean keepQuotes)
Defaults to false
keepQuotes - flag indicating whether enclosing quotes should be maintained when parsing quoted values.CsvParserSettings instanceprotected void addConfiguration(Map<String,Object> out)
addConfiguration in class CommonParserSettings<CsvFormat>public final CsvParserSettings clone()
CommonSettingsCommonSettings.clone(boolean) method to reset properties that are
specific to a given input, such as header names and selection of fields.clone in class CommonParserSettings<CsvFormat>public final CsvParserSettings clone(boolean clearInputSpecificSettings)
CommonSettingsclearInputSpecificSettings flag is set to trueclone in class CommonParserSettings<CsvFormat>clearInputSpecificSettings - flag indicating whether to clear settings that are likely to be associated with a given input.public final char[] getDelimitersForDetection()
isDelimiterDetectionEnabled() evaluates
to true, in order of priority.public boolean getIgnoreTrailingWhitespacesInQuotes()
keepQuotes evaluates to true, values won't be trimmed.public CsvParserSettings setIgnoreTrailingWhitespacesInQuotes(boolean ignoreTrailingWhitespacesInQuotes)
keepQuotes evaluates to true, values won't be trimmed.ignoreTrailingWhitespacesInQuotes - whether trailing whitespaces from quoted values should be skippedCsvParserSettings instancepublic boolean getIgnoreLeadingWhitespacesInQuotes()
keepQuotes evaluates to true, values won't be trimmed.public CsvParserSettings setIgnoreLeadingWhitespacesInQuotes(boolean ignoreLeadingWhitespacesInQuotes)
keepQuotes evaluates to true, values won't be trimmed.ignoreLeadingWhitespacesInQuotes - whether leading whitespaces from quoted values should be skippedCsvParserSettings instancepublic final CsvParserSettings trimQuotedValues(boolean trim)
setIgnoreLeadingWhitespacesInQuotes(boolean) and setIgnoreTrailingWhitespacesInQuotes(boolean)
Note: if keepQuotes evaluates to true, values won't be trimmed.trim - a flag indicating whether whitespaces around values extracted from a quoted field should be removedCsvParserSettings instancepublic CsvParserSettings setNullValue(String emptyValue)
When reading, if the parser does not read any character from the input, the nullValue is used instead of an empty string
When writing, if the writer has a null object to write to the output, the nullValue is used instead of an empty string
setNullValue in class CommonSettings<CsvFormat>emptyValue - the String representation of a null valueCsvParserSettings instancepublic CsvParserSettings setMaxCharsPerColumn(int maxCharsPerColumn)
To enable auto-expansion of the internal array, set this property to -1
setMaxCharsPerColumn in class CommonSettings<CsvFormat>maxCharsPerColumn - The maximum number of characters allowed for any given value being written/readCsvParserSettings instancepublic CsvParserSettings setSkipEmptyLines(boolean skipEmptyLines)
when reading, if the parser reads a line that is empty, it will be skipped.
when writing, if the writer receives an empty or null row to write to the output, it will be ignored
setSkipEmptyLines in class CommonSettings<CsvFormat>skipEmptyLines - true if empty lines should be ignored, false otherwiseCsvParserSettings instancepublic CsvParserSettings setIgnoreTrailingWhitespaces(boolean ignoreTrailingWhitespaces)
setIgnoreTrailingWhitespaces in class CommonSettings<CsvFormat>ignoreTrailingWhitespaces - true if trailing whitespaces from values being read/written should be skipped, false otherwiseCsvParserSettings instancepublic CsvParserSettings setIgnoreLeadingWhitespaces(boolean ignoreLeadingWhitespaces)
setIgnoreLeadingWhitespaces in class CommonSettings<CsvFormat>ignoreLeadingWhitespaces - true if leading whitespaces from values being read/written should be skipped, false otherwiseCsvParserSettings instancepublic CsvParserSettings setHeaders(String... headers)
when reading, the given header names will be used to refer to each column irrespective of whether or not the input contains a header row
when writing, the given header names will be used to refer to each column and can be used for writing the header row
setHeaders in class CommonSettings<CsvFormat>headers - the field name sequence associated with each column in the input/output.CsvParserSettings instancepublic CsvParserSettings setHeadersDerivedFromClass(Class<?> headerSourceClass, String... headers)
Parsed annotated attributes/methods.
when reading, the given header names will be used to refer to each column irrespective of whether or not the input contains a header row
when writing, the given header names will be used to refer to each column and can be used for writing the header row
setHeadersDerivedFromClass in class CommonSettings<CsvFormat>headerSourceClass - the class from which the headers have been derived.headers - the field name sequence associated with each column in the input/output.CsvParserSettings instancepublic CsvParserSettings setMaxColumns(int maxColumns)
setMaxColumns in class CommonSettings<CsvFormat>maxColumns - The maximum number of columns a record can have.CsvParserSettings instancepublic CsvParserSettings setFormat(CsvFormat format)
setFormat in class CommonSettings<CsvFormat>format - The format of the file to be parsed/writtenCsvParserSettings instancepublic final CsvParserSettings setAutoConfigurationEnabled(boolean autoConfigurationEnabled)
BeanWriterProcessor where the bean class contains a Headers annotation, or to enable header extraction when the bean class of a
BeanProcessor has attributes mapping to header names.setAutoConfigurationEnabled in class CommonSettings<CsvFormat>autoConfigurationEnabled - a flag to turn the automatic configuration feature on/off.CsvParserSettings instance@Deprecated public CsvParserSettings setRowProcessorErrorHandler(RowProcessorErrorHandler rowProcessorErrorHandler)
setProcessorErrorHandler(ProcessorErrorHandler) method as it allows format-specific error handlers to be built to work with different implementations of Context.
Implementations based on RowProcessorErrorHandler allow only parsers who provide a ParsingContext to be used.RowProcessor
or a RowWriterProcessor (i.e. non-fatal DataProcessingExceptions).
The parsing parsing/writing won't stop (unless the error handler rethrows the DataProcessingException or manually stops the process).
setRowProcessorErrorHandler in class CommonSettings<CsvFormat>rowProcessorErrorHandler - the callback error handler with custom code to manage occurrences of DataProcessingException.CsvParserSettings instancepublic CsvParserSettings setProcessorErrorHandler(ProcessorErrorHandler<? extends Context> processorErrorHandler)
Processor
or a RowWriterProcessor (i.e. non-fatal DataProcessingExceptions).
The parsing parsing/writing won't stop (unless the error handler rethrows the DataProcessingException or manually stops the process).
setProcessorErrorHandler in class CommonSettings<CsvFormat>processorErrorHandler - the callback error handler with custom code to manage occurrences of DataProcessingException.CsvParserSettings instancepublic CsvParserSettings setErrorContentLength(int errorContentLength)
If set to 0, then no exceptions will include the content being manipulated in their attributes,
and the "<omitted>" string will appear in error messages as the parsed/written content.
defaults to -1 (no limit)
setErrorContentLength in class CommonSettings<CsvFormat>errorContentLength - maximum length of contents displayed in exception messages in case of errors while parsing/writing.CsvParserSettings instancepublic final CsvParserSettings setSkipBitsAsWhitespace(boolean skipBitsAsWhitespace)
character <= ' ' evaluates to
true. This includes bit values, i.e. 0 (the \0 character) and 1 which might
be produced by database dumps. Disabling this flag will prevent the parser/writer from discarding these characters
when CommonSettings.getIgnoreLeadingWhitespaces() or CommonSettings.getIgnoreTrailingWhitespaces() evaluate to true.
defaults to true
setSkipBitsAsWhitespace in class CommonSettings<CsvFormat>skipBitsAsWhitespace - a flag indicating whether bit values (0 or 1) should be considered whitespace.CsvParserSettings instancepublic int getFormatDetectorRowSampleCount()
public void setFormatDetectorRowSampleCount(int formatDetectorRowSampleCount)
formatDetectorRowSampleCount - the number of sample rows used in the CSV format auto-detection processCopyright © 2024. All rights reserved.