olg.csv.base.csv
Class CSVSettings

java.lang.Object
  extended by olg.csv.base.csv.CSVSettings

public class CSVSettings
extends Object

CSV Settings class to reading and writing.

See Also:
CSVWriter, CSVReader

Field Summary
static String DEFAULT_CHARSETNAME
          Default charset of this Java virtual machine.
static char DEFAULT_DELIMITER
          Default delimiter.
static boolean DEFAULT_FORCEDELIMITER
          Default force delimiter.
static String DEFAULT_LINESEPARATOR
          Default line separator :operating system line separator.
static char DEFAULT_SEPARATOR
          default separator.
static boolean DEFAULT_SKIPEMPTYCELL
          Default option on skipping empty cell.
static boolean DEFAULT_WITHHEADERS
          Default with headers value.
static String LINUX_LINESEPARATOR
          Linux line separator.
static String MAC_LINESEPARATOR
          Mac Line serapator.
static String WINDOWS_LINESEPARATOR
          Dos line separator.
 
Constructor Summary
CSVSettings()
          CSV settings with default values.
CSVSettings(char delimiter, char separator)
          Defines settings with specified values.
CSVSettings(char delimiter, char separator, boolean withHeaders)
          Defines settings with specified values.
 
Method Summary
 String getCharsetName()
           
 char getDelimiter()
           
 String getLineSeparator()
          The line separator setting.
 char getSeparator()
           
 boolean isForceDelimiter()
          Indicate if each CSV field must to be delimited.
 boolean isSkipEmptyCell()
           
 boolean isWithHeaders()
          Indicates if the CSV file has headers.
 CSVSettings setCharsetName(String charsetName)
           
 CSVSettings setDelimiter(char delimiter)
           
 CSVSettings setForceDelimiter(boolean forceDelimiter)
           
 CSVSettings setLineSeparator(String lineSeparator)
           
 CSVSettings setSeparator(char separator)
           
 CSVSettings setSkipEmptyCell(boolean skipEmptyCell)
          Only for reading. if true the returned rows will only contain not empty cells.
 CSVSettings setWithHeaders(boolean withHeaders)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_DELIMITER

public static final char DEFAULT_DELIMITER
Default delimiter.

See Also:
Constant Field Values

DEFAULT_SEPARATOR

public static final char DEFAULT_SEPARATOR
default separator.

See Also:
Constant Field Values

DEFAULT_CHARSETNAME

public static final String DEFAULT_CHARSETNAME
Default charset of this Java virtual machine.


DEFAULT_LINESEPARATOR

public static final String DEFAULT_LINESEPARATOR
Default line separator :operating system line separator.


MAC_LINESEPARATOR

public static final String MAC_LINESEPARATOR
Mac Line serapator.

See Also:
Constant Field Values

LINUX_LINESEPARATOR

public static final String LINUX_LINESEPARATOR
Linux line separator.

See Also:
Constant Field Values

WINDOWS_LINESEPARATOR

public static final String WINDOWS_LINESEPARATOR
Dos line separator.

See Also:
Constant Field Values

DEFAULT_FORCEDELIMITER

public static final boolean DEFAULT_FORCEDELIMITER
Default force delimiter.

See Also:
Constant Field Values

DEFAULT_WITHHEADERS

public static final boolean DEFAULT_WITHHEADERS
Default with headers value.

See Also:
Constant Field Values

DEFAULT_SKIPEMPTYCELL

public static final boolean DEFAULT_SKIPEMPTYCELL
Default option on skipping empty cell.

See Also:
Constant Field Values
Constructor Detail

CSVSettings

public CSVSettings()
CSV settings with default values.


CSVSettings

public CSVSettings(char delimiter,
                   char separator)
Defines settings with specified values. Others fields are defined by default.

Parameters:
delimiter - the delimiter
separator - the separator

CSVSettings

public CSVSettings(char delimiter,
                   char separator,
                   boolean withHeaders)
Defines settings with specified values. Others fields are defined by default.

Parameters:
delimiter - the delimiter
separator - the separator
withHeaders - if the CSV file has headers.
Method Detail

getDelimiter

public char getDelimiter()
Returns:
the delimiter

setDelimiter

public CSVSettings setDelimiter(char delimiter)
Parameters:
delimiter - the delimiter
Returns:
the current settings

getSeparator

public char getSeparator()
Returns:
the separator.

setSeparator

public CSVSettings setSeparator(char separator)
Parameters:
separator - the separator
Returns:
the current settings

getCharsetName

public String getCharsetName()
Returns:
the charset name.

setCharsetName

public CSVSettings setCharsetName(String charsetName)
Parameters:
charsetName - the charset name
Returns:
the current settings.

isForceDelimiter

public boolean isForceDelimiter()
Indicate if each CSV field must to be delimited.

Returns:
if the use of delimiter is forced(CSV writing).

setForceDelimiter

public CSVSettings setForceDelimiter(boolean forceDelimiter)
Parameters:
forceDelimiter - the forceDelimiter setting.
Returns:
the current settings.

isWithHeaders

public boolean isWithHeaders()
Indicates if the CSV file has headers.

Returns:
the withHeader setting.

setWithHeaders

public CSVSettings setWithHeaders(boolean withHeaders)
Parameters:
withHeaders - the withHeader setting.
Returns:
the current settings.

isSkipEmptyCell

public boolean isSkipEmptyCell()
Returns:
if true the returned rows will only contain not empty cells.

setSkipEmptyCell

public CSVSettings setSkipEmptyCell(boolean skipEmptyCell)
Only for reading. if true the returned rows will only contain not empty cells.

Parameters:
skipEmptyCell - the skipEmptyCell setting.
Returns:
the current settings.

getLineSeparator

public String getLineSeparator()
The line separator setting.

Returns:
the line separator setting.

setLineSeparator

public CSVSettings setLineSeparator(String lineSeparator)
Parameters:
lineSeparator - the line separator setting.
Returns:
the current settings.


Copyright © 2014. All rights reserved.