com.fasterxml.jackson.dataformat.csv
Enum CsvGenerator.Feature

java.lang.Object
  extended by java.lang.Enum<CsvGenerator.Feature>
      extended by com.fasterxml.jackson.dataformat.csv.CsvGenerator.Feature
All Implemented Interfaces:
com.fasterxml.jackson.core.FormatFeature, Serializable, Comparable<CsvGenerator.Feature>
Enclosing class:
CsvGenerator

public static enum CsvGenerator.Feature
extends Enum<CsvGenerator.Feature>
implements com.fasterxml.jackson.core.FormatFeature

Enumeration that defines all togglable features for CSV writers (if any: currently none)


Enum Constant Summary
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.
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.
 
Field Summary
protected  boolean _defaultState
           
protected  int _mask
           
 
Method Summary
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.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

STRICT_CHECK_FOR_QUOTING

public static final CsvGenerator.Feature 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. Trade-offs is basically between optimal/minimal quoting (true), and faster handling (false). Faster check involves only checking first N characters of value, as well as possible looser checks.

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.

Since:
2.4

OMIT_MISSING_TAIL_COLUMNS

public static final CsvGenerator.Feature OMIT_MISSING_TAIL_COLUMNS
Feature that determines whether columns without matching value may be omitted, when they are the last values of the row. If 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.

Since:
2.4

ALWAYS_QUOTE_STRINGS

public static final CsvGenerator.Feature 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. Note that this feature has precedence over STRICT_CHECK_FOR_QUOTING, when both would be applicable.

Since:
2.5
Field Detail

_defaultState

protected final boolean _defaultState

_mask

protected final int _mask
Method Detail

values

public static CsvGenerator.Feature[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (CsvGenerator.Feature c : CsvGenerator.Feature.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static CsvGenerator.Feature valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null

collectDefaults

public static int collectDefaults()
Method that calculates bit set (flags) of all features that are enabled by default.


enabledIn

public boolean enabledIn(int flags)
Specified by:
enabledIn in interface com.fasterxml.jackson.core.FormatFeature

enabledByDefault

public boolean enabledByDefault()
Specified by:
enabledByDefault in interface com.fasterxml.jackson.core.FormatFeature

getMask

public int getMask()
Specified by:
getMask in interface com.fasterxml.jackson.core.FormatFeature


Copyright © 2016 FasterXML. All rights reserved.