org.supercsv.prefs
Class CsvPreference

java.lang.Object
  extended by org.supercsv.prefs.CsvPreference

public class CsvPreference
extends Object

Before reading or writing CSV files, you must supply the reader/writer with a setup (this object)

Author:
Kasper B. Graversen

Field Summary
protected  int delimiterChar
           
protected  String endOfLineSymbols
          Only used when writing.
static CsvPreference EXCEL_NORTH_EUROPE_PREFERENCE
          Ready to use configuration for north european excel CSV files (columns are separated by ";" instead of ",")
static CsvPreference EXCEL_PREFERENCE
          Ready to use configuration for reading Windows Excel exported CSV files.
static CsvPreference NO_COMMENT_PREFERENCE
          Ready to use configuration.
protected  char quoteChar
           
static CsvPreference STANDARD_PREFERENCE
          Ready to use configuration.
 
Constructor Summary
CsvPreference(char quoteChar, int delimiterChar, String endOfLineSymbols)
          Set the preference for readers and writers
 
Method Summary
 int getDelimiterChar()
           
 String getEndOfLineSymbols()
           
 int getQuoteChar()
           
 CsvPreference setDelimiterChar(int delimiterChar)
           
 CsvPreference setEndOfLineSymbols(String endOfLineSymbols)
           
 CsvPreference setQuoteChar(char quoteChar)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

STANDARD_PREFERENCE

public static final CsvPreference STANDARD_PREFERENCE
Ready to use configuration. This one should cover 99% of all usages of the package


EXCEL_PREFERENCE

public static final CsvPreference EXCEL_PREFERENCE
Ready to use configuration for reading Windows Excel exported CSV files.


EXCEL_NORTH_EUROPE_PREFERENCE

public static final CsvPreference EXCEL_NORTH_EUROPE_PREFERENCE
Ready to use configuration for north european excel CSV files (columns are separated by ";" instead of ",")


NO_COMMENT_PREFERENCE

public static final CsvPreference NO_COMMENT_PREFERENCE
Ready to use configuration. Reading and making sure no data is accidently parsed as comments


quoteChar

protected char quoteChar

delimiterChar

protected int delimiterChar

endOfLineSymbols

protected String endOfLineSymbols
Only used when writing. Recommended "\n" or for mac "\r" or if special sequences are needed such as "\n"

Constructor Detail

CsvPreference

public CsvPreference(char quoteChar,
                     int delimiterChar,
                     String endOfLineSymbols)
Set the preference for readers and writers

Parameters:
quoteChar - Specifies that matching pairs of this character delimit string constants in this tokenizer.
delimiterChar - Specifies the character separating each column
endOfLineSymbols - one or more symbols terminating the line, e.g. "\n". This parameter only makes sense for writers
Method Detail

getDelimiterChar

public int getDelimiterChar()

getEndOfLineSymbols

public String getEndOfLineSymbols()

getQuoteChar

public int getQuoteChar()

setDelimiterChar

public CsvPreference setDelimiterChar(int delimiterChar)

setEndOfLineSymbols

public CsvPreference setEndOfLineSymbols(String endOfLineSymbols)

setQuoteChar

public CsvPreference setQuoteChar(char quoteChar)