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

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

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

Enumeration that defines all togglable features for CSV parsers


Enum Constant Summary
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.
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).
 
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 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.
 
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

TRIM_SPACES

public static final CsvParser.Feature TRIM_SPACES
Feature determines whether spaces around separator characters (commas) are to be automatically trimmed before being reported or not. Note that this does NOT force trimming of possible white space from within double-quoted values, but only those surrounding unquoted values (white space outside of double-quotes is never included regardless of trimming).

Default value is false, as per RFC-4180.


WRAP_AS_ARRAY

public static final CsvParser.Feature 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). Using stream of Objects is convenient when using ObjectMapper.readValues(...) and array of Objects convenient when binding to Lists 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.


IGNORE_TRAILING_UNMAPPABLE

public static final CsvParser.Feature 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. When disabled, an exception is thrown for such column values, but if enabled, they are silently ignored.

Since:
2.7
Method Detail

values

public static CsvParser.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 (CsvParser.Feature c : CsvParser.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 CsvParser.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.


enabledByDefault

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

enabledIn

public boolean enabledIn(int flags)
Specified by:
enabledIn 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.