| Package | Description |
|---|---|
| com.univocity.parsers.csv |
| Modifier and Type | Method and Description |
|---|---|
CsvParserSettings |
CsvParserSettings.clone() |
CsvParserSettings |
CsvParserSettings.clone(boolean clearInputSpecificSettings) |
protected CsvParserSettings |
CsvRoutines.createDefaultParserSettings() |
CsvParserSettings |
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)
|
static CsvParserSettings |
Csv.parseExcel()
Provides a basic CSV configuration that allows parsing CSV files produced by Microsoft Excel.
|
static CsvParserSettings |
Csv.parseRfc4180()
Provides a basic CSV configuration for parsing CSV files in accordance with the
rules established by RFC 4180
|
CsvParserSettings |
CsvParserSettings.setAutoConfigurationEnabled(boolean autoConfigurationEnabled)
Indicates whether this settings object can automatically derive configuration options.
|
CsvParserSettings |
CsvParserSettings.setDelimiterDetectionEnabled(boolean separatorDetectionEnabled,
char... delimitersForDetection)
Configures the parser to analyze the input before parsing to discover the column delimiter character.
|
CsvParserSettings |
CsvParserSettings.setEmptyValue(String emptyValue)
Sets the String representation of an empty value (defaults to null)
|
CsvParserSettings |
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 |
CsvParserSettings.setEscapeUnquotedValues(boolean escapeUnquotedValues)
Configures the parser to process escape sequences in unquoted values.
|
CsvParserSettings |
CsvParserSettings.setFormat(CsvFormat format)
Defines the format of the file to be parsed/written (returns the format's defaults).
|
CsvParserSettings |
CsvParserSettings.setHeaders(String... headers)
Defines the field names in the input/output, in the sequence they occur (defaults to null).
|
CsvParserSettings |
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 |
CsvParserSettings.setIgnoreLeadingWhitespaces(boolean ignoreLeadingWhitespaces)
Defines whether or not leading whitespaces from values being read/written should be skipped (defaults to true)
|
CsvParserSettings |
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 |
CsvParserSettings.setIgnoreTrailingWhitespaces(boolean ignoreTrailingWhitespaces)
Defines whether or not trailing whitespaces from values being read/written should be skipped (defaults to true)
|
CsvParserSettings |
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 |
CsvParserSettings.setKeepEscapeSequences(boolean keepEscapeSequences)
Configures the parser to keep any escape sequences if they are present in the input (i.e.
|
CsvParserSettings |
CsvParserSettings.setKeepQuotes(boolean keepQuotes)
Configures the parser to keep enclosing quote characters in the values parsed from the input.
|
CsvParserSettings |
CsvParserSettings.setMaxCharsPerColumn(int maxCharsPerColumn)
Defines the maximum number of characters allowed for any given value being written/read.
|
CsvParserSettings |
CsvParserSettings.setMaxColumns(int maxColumns)
Defines a hard limit of how many columns a record can have (defaults to 512).
|
CsvParserSettings |
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 |
CsvParserSettings.setNullValue(String emptyValue)
Sets the String representation of a null value (defaults to null)
|
CsvParserSettings |
CsvParserSettings.setParseUnescapedQuotes(boolean parseUnescapedQuotes)
Deprecated.
use
setUnescapedQuoteHandling(UnescapedQuoteHandling) instead. The configuration returned by getUnescapedQuoteHandling()
will override this setting if not null. |
CsvParserSettings |
CsvParserSettings.setParseUnescapedQuotesUntilDelimiter(boolean parseUnescapedQuotesUntilDelimiter)
Deprecated.
use
setUnescapedQuoteHandling(UnescapedQuoteHandling) instead. The configuration returned by getUnescapedQuoteHandling()
will override this setting if not null. |
CsvParserSettings |
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 |
CsvParserSettings.setQuoteDetectionEnabled(boolean quoteDetectionEnabled)
Configures the parser to analyze the input before parsing to discover the quote character.
|
CsvParserSettings |
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 |
CsvParserSettings.setSkipBitsAsWhitespace(boolean skipBitsAsWhitespace)
Configures the parser to skip bit values as whitespace.
|
CsvParserSettings |
CsvParserSettings.setSkipEmptyLines(boolean skipEmptyLines)
Defines whether or not empty lines should be ignored (defaults to true)
|
CsvParserSettings |
CsvParserSettings.setUnescapedQuoteHandling(UnescapedQuoteHandling unescapedQuoteHandling)
Configures the handling of values with unescaped quotes.
|
CsvParserSettings |
CsvParserSettings.trimQuotedValues(boolean trim)
Configures the parser to trim any whitespaces around values extracted from within quotes.
|
| Modifier and Type | Method and Description |
|---|---|
protected CsvParser |
CsvRoutines.createParser(CsvParserSettings parserSettings) |
| Constructor and Description |
|---|
CsvFormatDetector(int maxRowSamples,
CsvParserSettings settings,
int whitespaceRangeStart)
Builds a new
CsvFormatDetector |
CsvParser(CsvParserSettings settings)
The CsvParser supports all settings provided by
CsvParserSettings, and requires this configuration to be properly initialized. |
CsvRoutines(CsvParserSettings parserSettings)
Creates a new instance of the CSV routine class.
|
CsvRoutines(CsvParserSettings parserSettings,
CsvWriterSettings writerSettings)
Creates a new instance of the CSV routine class.
|
Copyright © 2024. All rights reserved.