com.fasterxml.jackson.dataformat.csv
Enum CsvSchema.ColumnType

java.lang.Object
  extended by java.lang.Enum<CsvSchema.ColumnType>
      extended by com.fasterxml.jackson.dataformat.csv.CsvSchema.ColumnType
All Implemented Interfaces:
Serializable, Comparable<CsvSchema.ColumnType>
Enclosing class:
CsvSchema

public static enum CsvSchema.ColumnType
extends Enum<CsvSchema.ColumnType>

Enumeration that defines optional type indicators that can be passed with schema. If used type is used to determine type of JsonToken that column values are exposed as.


Enum Constant Summary
NUMBER
          Value should be a number, but literals "null", "true" and "false" are also understood, and an empty String is considered null.
NUMBER_OR_STRING
          Value is taken to be a number (if it matches valid JSON number formatting rules), literal (null, true or false) or String, depending on best match.
STRING
          Default type if not explicitly defined; value will be presented as VALUE_STRING by parser, that is, no type-inference is performed, and value is not trimmed.
STRING_OR_LITERAL
          Value is considered to be a String, except that tokens "null", "true" and "false" are recognized as matching tokens and reported as such; and values are trimmed (leading/trailing white space)
 
Method Summary
static CsvSchema.ColumnType valueOf(String name)
          Returns the enum constant of this type with the specified name.
static CsvSchema.ColumnType[] 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

STRING

public static final CsvSchema.ColumnType STRING
Default type if not explicitly defined; value will be presented as VALUE_STRING by parser, that is, no type-inference is performed, and value is not trimmed.


STRING_OR_LITERAL

public static final CsvSchema.ColumnType STRING_OR_LITERAL
Value is considered to be a String, except that tokens "null", "true" and "false" are recognized as matching tokens and reported as such; and values are trimmed (leading/trailing white space)


NUMBER

public static final CsvSchema.ColumnType NUMBER
Value should be a number, but literals "null", "true" and "false" are also understood, and an empty String is considered null. Values are also trimmed (leading/trailing white space) Other non-numeric Strings will cause parsing exception.


NUMBER_OR_STRING

public static final CsvSchema.ColumnType NUMBER_OR_STRING
Value is taken to be a number (if it matches valid JSON number formatting rules), literal (null, true or false) or String, depending on best match. Values are also trimmed (leading/trailing white space)

Method Detail

values

public static CsvSchema.ColumnType[] 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 (CsvSchema.ColumnType c : CsvSchema.ColumnType.values())
    System.out.println(c);

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

valueOf

public static CsvSchema.ColumnType 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


Copyright © 2012 fasterxml.com. All Rights Reserved.