public static enum CsvGenerator.Feature extends Enum<CsvGenerator.Feature> implements com.fasterxml.jackson.core.FormatFeature
Enum Constant and Description |
---|
ALWAYS_QUOTE_EMPTY_STRINGS
Feature that determines whether values written as empty Strings (from
java.lang.String
valued POJO properties) should be forced to be quoted. |
ALWAYS_QUOTE_STRINGS
Feature that determines whether values written as Strings (from
java.lang.String
valued POJO properties) should be forced to be quoted, regardless of whether they
actually need this. |
ESCAPE_CONTROL_CHARS_WITH_ESCAPE_CHAR
Feature that determines whether control characters (non-printable) are escaped using the
configured escape character.
|
ESCAPE_QUOTE_CHAR_WITH_ESCAPE_CHAR
Feature that determines whether quote characters within quoted String values are escaped
using configured escape character, instead of being "doubled up" (that is: a quote character
is written twice in a row).
|
OMIT_MISSING_TAIL_COLUMNS
Feature that determines whether columns without matching value may be omitted,
when they are the last values of the row.
|
STRICT_CHECK_FOR_QUOTING
Feature that determines how much work is done before determining that
a column value requires quoting: when set as
true , full
check is made to only use quoting when it is strictly necessary;
but when false , a faster but more conservative check
is made, and possibly quoting is used for values that might not need it. |
Modifier and Type | Field and Description |
---|---|
protected boolean |
_defaultState |
protected int |
_mask |
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 CsvGenerator.Feature |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static CsvGenerator.Feature[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final CsvGenerator.Feature STRICT_CHECK_FOR_QUOTING
true
, full
check is made to only use quoting when it is strictly necessary;
but when false
, a faster but more conservative check
is made, and possibly quoting is used for values that might not need it.
Trade-offs is basically between optimal/minimal quoting (true), and
possibly faster handling (false).
Faster check involves only checking first N characters of value, as well
as possible looser checks.
However: strict check can also be more efficient in some cases when it
allows omitting quoting, so trade-off is not always simple.
Note, however, that regardless setting, all values that need to be quoted
will be: it is just that when set to false
, other values may
also be quoted (to avoid having to do more expensive checks).
Default value is false
for "loose" (approximate, conservative)
checking.
public static final CsvGenerator.Feature OMIT_MISSING_TAIL_COLUMNS
true
, values and separators between values may be omitted, to slightly reduce
length of the row; if false
, separators need to stay in place and values
are indicated by empty Strings.public static final CsvGenerator.Feature ALWAYS_QUOTE_STRINGS
java.lang.String
valued POJO properties) should be forced to be quoted, regardless of whether they
actually need this.
Note that this feature has precedence over STRICT_CHECK_FOR_QUOTING
, when
both would be applicable.public static final CsvGenerator.Feature ALWAYS_QUOTE_EMPTY_STRINGS
java.lang.String
valued POJO properties) should be forced to be quoted.public static final CsvGenerator.Feature ESCAPE_QUOTE_CHAR_WITH_ESCAPE_CHAR
Default value is false so that quotes are doubled as necessary, not escaped.
public static final CsvGenerator.Feature ESCAPE_CONTROL_CHARS_WITH_ESCAPE_CHAR
\nand
\rinstead of being echoed out. This is a compatibility feature for some parsers that can not read such output back in.
Default value is false so that control characters are echoed out (backwards compatible).
public static CsvGenerator.Feature[] values()
for (CsvGenerator.Feature c : CsvGenerator.Feature.values()) System.out.println(c);
public static CsvGenerator.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 enabledIn(int flags)
enabledIn
in interface com.fasterxml.jackson.core.FormatFeature
enabledIn
in interface com.fasterxml.jackson.core.util.JacksonFeature
public boolean enabledByDefault()
enabledByDefault
in interface com.fasterxml.jackson.core.FormatFeature
enabledByDefault
in interface com.fasterxml.jackson.core.util.JacksonFeature
public int getMask()
getMask
in interface com.fasterxml.jackson.core.FormatFeature
getMask
in interface com.fasterxml.jackson.core.util.JacksonFeature
Copyright © 2022 FasterXML. All rights reserved.