public static enum CsvParser.Feature extends Enum<CsvParser.Feature> implements com.fasterxml.jackson.core.FormatFeature
Enum Constant and Description |
---|
ALLOW_COMMENTS
Feature that allows accepting "hash comments" by default, similar to
CsvSchema.withAllowComments(boolean) . |
ALLOW_TRAILING_COMMA
Feature that allows there to be a trailing single extraneous data
column that is empty.
|
FAIL_ON_MISSING_COLUMNS
Feature that allows failing (with a
CsvMappingException ) in cases
where number of column values encountered is less than number of columns
declared in active schema ("missing columns"). |
IGNORE_TRAILING_UNMAPPABLE
Feature that allows ignoring of unmappable "extra" columns; that is, values for
columns that appear after columns for which types are defined.
|
INSERT_NULLS_FOR_MISSING_COLUMNS
Feature that allows "inserting" virtual key / `null` value pairs in case
a row contains fewer columns than declared by configured schema.
|
SKIP_EMPTY_LINES
Feature that allows skipping input lines that are completely empty, instead
of being decoded as lines of just a single column with empty String value (or,
depending on binding, `null`).
|
TRIM_SPACES
Feature determines whether spaces around separator characters
(commas) are to be automatically trimmed before being reported
or not.
|
WRAP_AS_ARRAY
Feature that determines how stream of records (usually CSV lines, but sometimes
multiple lines when linefeeds are included in quoted values) is exposed:
either as a sequence of Objects (false), or as an Array of Objects (true).
|
Modifier and Type | Method and Description |
---|---|
static int |
collectDefaults()
Method that calculates bit set (flags) of all features that
are enabled by default.
|
boolean |
enabledByDefault() |
boolean |
enabledIn(int flags) |
int |
getMask() |
static CsvParser.Feature |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static CsvParser.Feature[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final CsvParser.Feature TRIM_SPACES
Default value is false, as per RFC-4180.
public static final CsvParser.Feature WRAP_AS_ARRAY
ObjectMapper.readValues(...)
and array of Objects convenient when binding to List
s or
arrays of values.
Default value is false, meaning that by default a CSV document is exposed as a sequence of root-level Object entries.
public static final CsvParser.Feature IGNORE_TRAILING_UNMAPPABLE
Feature is disabled by default.
public static final CsvParser.Feature SKIP_EMPTY_LINES
Feature is disabled by default.
public static final CsvParser.Feature ALLOW_TRAILING_COMMA
public static final CsvParser.Feature ALLOW_COMMENTS
CsvSchema.withAllowComments(boolean)
. If enabled, such comments
are by default allowed on all columns of all documents.public static final CsvParser.Feature FAIL_ON_MISSING_COLUMNS
CsvMappingException
) in cases
where number of column values encountered is less than number of columns
declared in active schema ("missing columns").
Note that this feature has precedence over INSERT_NULLS_FOR_MISSING_COLUMNS
Feature is disabled by default.
public static final CsvParser.Feature INSERT_NULLS_FOR_MISSING_COLUMNS
Note that this feature is only considered if
INSERT_NULLS_FOR_MISSING_COLUMNS
is disabled.
Feature is disabled by default.
public static CsvParser.Feature[] values()
for (CsvParser.Feature c : CsvParser.Feature.values()) System.out.println(c);
public static CsvParser.Feature valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic static int collectDefaults()
public boolean enabledByDefault()
enabledByDefault
in interface com.fasterxml.jackson.core.FormatFeature
public boolean enabledIn(int flags)
enabledIn
in interface com.fasterxml.jackson.core.FormatFeature
public int getMask()
getMask
in interface com.fasterxml.jackson.core.FormatFeature
Copyright © 2019 FasterXML. All rights reserved.