com.fasterxml.jackson.dataformat.csv
Enum CsvEncoding

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

public enum CsvEncoding
extends Enum<CsvEncoding>

Enumeration that defines commond encodings that can be used for CSV content; similar to how JsonEncoding defines encodings for JSON. Note, however, that there is no specification on encodings that CSV files can take; and most commonly only UTF-8 or Latin-1 is used.

Note: if application want to explicitly disregard Encoding limitations (to read in content encoded using an encoding not listed as allowed), they can use Reader instances as input


Enum Constant Summary
LATIN1
           
UTF16_BE
           
UTF16_LE
           
UTF32_BE
           
UTF32_LE
           
UTF8
           
 
Field Summary
protected  boolean _bigEndian
           
protected  String _javaName
           
 
Method Summary
static CsvEncoding from(com.fasterxml.jackson.core.JsonEncoding enc)
           
 String getJavaName()
          Method for accessing encoding name that JDK will support.
 boolean isBigEndian()
          Whether encoding is big-endian (if encoding supports such notion).
static CsvEncoding valueOf(String name)
          Returns the enum constant of this type with the specified name.
static CsvEncoding[] 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

UTF8

public static final CsvEncoding UTF8

UTF16_BE

public static final CsvEncoding UTF16_BE

UTF16_LE

public static final CsvEncoding UTF16_LE

UTF32_BE

public static final CsvEncoding UTF32_BE

UTF32_LE

public static final CsvEncoding UTF32_LE

LATIN1

public static final CsvEncoding LATIN1
Field Detail

_javaName

protected final String _javaName

_bigEndian

protected final boolean _bigEndian
Method Detail

values

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

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

valueOf

public static CsvEncoding 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

from

public static CsvEncoding from(com.fasterxml.jackson.core.JsonEncoding enc)

getJavaName

public String getJavaName()
Method for accessing encoding name that JDK will support.

Returns:
Matching encoding name that JDK will support.

isBigEndian

public boolean isBigEndian()
Whether encoding is big-endian (if encoding supports such notion). If no such distinction is made (as is the case for UTF8), return value is undefined.

Returns:
True for big-endian encodings; false for little-endian (or if not applicable)


Copyright © 2012 fasterxml.com. All Rights Reserved.