com.univocity.parsers.csv
Class CsvParserSettings

java.lang.Object
  extended by com.univocity.parsers.common.CommonSettings<F>
      extended by com.univocity.parsers.common.CommonParserSettings<CsvFormat>
          extended by com.univocity.parsers.csv.CsvParserSettings

public class CsvParserSettings
extends CommonParserSettings<CsvFormat>

This is the configuration class used by the CSV parser (CsvParser)

In addition to the configuration options provided by CommonParserSettings, the CSVParserSettings include:

Author:
uniVocity Software Pty Ltd - [email protected]
See Also:
CsvParser, CsvFormat, CommonParserSettings

Constructor Summary
CsvParserSettings()
           
 
Method Summary
protected  CsvFormat createDefaultFormat()
          Returns the default CsvFormat configured to handle CSV inputs compliant to the RFC4180 standard.
 String getEmptyValue()
          Returns the String representation of an empty value (defaults to null)
protected  CharAppender newCharAppender()
          Returns an instance of CharAppender with the configured limit of maximum characters per column and the default value used to represent an empty value (when the String parsed from the input, within quotes, is empty)
 void setEmptyValue(String emptyValue)
          Sets the String representation of an empty value (defaults to null)
 
Methods inherited from class com.univocity.parsers.common.CommonParserSettings
getInputBufferSize, getNumberOfRecordsToRead, getReadInputOnSeparateThread, getRowProcessor, isColumnReorderingEnabled, isHeaderExtractionEnabled, setColumnReorderingEnabled, setHeaderExtractionEnabled, setInputBufferSize, setNumberOfRecordsToRead, setReadInputOnSeparateThread, setRowProcessor
 
Methods inherited from class com.univocity.parsers.common.CommonSettings
excludeFields, excludeIndexes, getFormat, getHeaders, getIgnoreLeadingWhitespaces, getIgnoreTrailingWhitespaces, getMaxCharsPerColumn, getMaxColumns, getNullValue, getSkipEmptyLines, selectFields, selectIndexes, setFormat, setHeaders, setIgnoreLeadingWhitespaces, setIgnoreTrailingWhitespaces, setMaxCharsPerColumn, setMaxColumns, setNullValue, setSkipEmptyLines
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CsvParserSettings

public CsvParserSettings()
Method Detail

getEmptyValue

public String getEmptyValue()
Returns the String representation of an empty value (defaults to null)

When reading, if the parser does not read any character from the input, and the input is within quotes, the empty is used instead of an empty string

Returns:
the String representation of an empty value

setEmptyValue

public void setEmptyValue(String emptyValue)
Sets the String representation of an empty value (defaults to null)

When reading, if the parser does not read any character from the input, and the input is within quotes, the empty is used instead of an empty string

Parameters:
emptyValue - the String representation of an empty value

newCharAppender

protected CharAppender newCharAppender()
Returns an instance of CharAppender with the configured limit of maximum characters per column and the default value used to represent an empty value (when the String parsed from the input, within quotes, is empty)

This overrides the parent's version because the CSV parser does not rely on the appender to identify null values, but on the other hand, the appender is required to identify empty values.

Overrides:
newCharAppender in class CommonParserSettings<CsvFormat>
Returns:
an instance of CharAppender with the configured limit of maximum characters per column and the default value used to represent an empty value (when the String parsed from the input, within quotes, is empty)

createDefaultFormat

protected CsvFormat createDefaultFormat()
Returns the default CsvFormat configured to handle CSV inputs compliant to the RFC4180 standard.

Specified by:
createDefaultFormat in class CommonSettings<CsvFormat>
Returns:
and instance of CsvFormat configured to handle CSV inputs compliant to the RFC4180 standard.


Copyright © 2014 uniVocity Software Pty Ltd. All rights reserved.