com.univocity.parsers.tsv
Class TsvParserSettings

java.lang.Object
  extended by com.univocity.parsers.common.CommonSettings<F>
      extended by com.univocity.parsers.common.CommonParserSettings<TsvFormat>
          extended by com.univocity.parsers.tsv.TsvParserSettings

public class TsvParserSettings
extends CommonParserSettings<TsvFormat>

This is the configuration class used by the TSV parser (TsvParser)

It supports the configuration options provided by CommonParserSettings only

Author:
uniVocity Software Pty Ltd - parsers@univocity.com
See Also:
TsvParser, TsvFormat, CommonParserSettings

Constructor Summary
TsvParserSettings()
           
 
Method Summary
protected  void addConfiguration(Map<String,Object> out)
           
protected  TsvFormat createDefaultFormat()
          Returns the default TsvFormat configured to handle TSV inputs
 boolean isLineJoiningEnabled()
          Identifies whether or lines ending with the escape character (defined by TsvFormat.getEscapeChar() and followed by a line separator character should be joined with the following line.
 void setLineJoiningEnabled(boolean lineJoiningEnabled)
          Defines how the parser should handle escaped line separators.
 
Methods inherited from class com.univocity.parsers.common.CommonParserSettings
getInputBufferSize, getNumberOfRecordsToRead, getNumberOfRowsToSkip, getProcessor, getReadInputOnSeparateThread, getRowProcessor, isColumnReorderingEnabled, isCommentCollectionEnabled, isHeaderExtractionEnabled, isLineSeparatorDetectionEnabled, newCharAppender, setColumnReorderingEnabled, setCommentCollectionEnabled, setHeaderExtractionEnabled, setInputBufferSize, setLineSeparatorDetectionEnabled, setNumberOfRecordsToRead, setNumberOfRowsToSkip, setProcessor, setReadInputOnSeparateThread, setRowProcessor
 
Methods inherited from class com.univocity.parsers.common.CommonSettings
excludeFields, excludeFields, excludeIndexes, getErrorContentLength, getFormat, getHeaders, getIgnoreLeadingWhitespaces, getIgnoreTrailingWhitespaces, getMaxCharsPerColumn, getMaxColumns, getNullValue, getProcessorErrorHandler, getRowProcessorErrorHandler, getSkipEmptyLines, isAutoConfigurationEnabled, isProcessorErrorHandlerDefined, selectFields, selectFields, selectIndexes, setAutoConfigurationEnabled, setErrorContentLength, setFormat, setHeaders, setIgnoreLeadingWhitespaces, setIgnoreTrailingWhitespaces, setMaxCharsPerColumn, setMaxColumns, setNullValue, setProcessorErrorHandler, setRowProcessorErrorHandler, setSkipEmptyLines, toString, trimValues
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TsvParserSettings

public TsvParserSettings()
Method Detail

isLineJoiningEnabled

public boolean isLineJoiningEnabled()
Identifies whether or lines ending with the escape character (defined by TsvFormat.getEscapeChar() and followed by a line separator character should be joined with the following line. Typical examples include inputs where lines end with sequences such as: '\'+'\n' and '\'+'\r'+'\n'. When line joining is disabled (the default), the TsvParser converts sequences containing the escape character (typically '\') followed by characters 'n' or 'r' into a '\n' or '\r' character. It will continue processing the contents found in the same line, until a new line character is found. If line joining is enabled, the TsvParser will convert sequences containing the escape character, followed by characters '\n', '\r' or '\r\n', into a '\n' or '\r' character. It will continue processing the contents found in the next line, until a new line character is found, given it is not preceded by another escape character.

Returns:
true if line joining is enabled, otherwise false

setLineJoiningEnabled

public void setLineJoiningEnabled(boolean lineJoiningEnabled)
Defines how the parser should handle escaped line separators. By enabling lines joining, lines ending with the escape character (defined by TsvFormat.getEscapeChar() and followed by a line separator character will be joined with the following line. Typical examples include inputs where lines end with sequences such as: '\'+'\n' and '\'+'\r'+'\n'. When line joining is disabled (the default), the TsvParser converts sequences containing the escape character (typically '\') followed by characters 'n' or 'r' into a '\n' or '\r' character. It will continue processing the contents found in the same line, until a new line character is found. If line joining is enabled, the TsvParser will convert sequences containing the escape character, followed by characters '\n', '\r' or '\r\n', into a '\n' or '\r' character. It will continue processing the contents found in the next line, until a new line character is found, given it is not preceded by another escape character.

Parameters:
lineJoiningEnabled - a flag indicating whether or not to enable line joining.

createDefaultFormat

protected TsvFormat createDefaultFormat()
Returns the default TsvFormat configured to handle TSV inputs

Specified by:
createDefaultFormat in class CommonSettings<TsvFormat>
Returns:
and instance of TsvFormat configured to handle TSV

addConfiguration

protected void addConfiguration(Map<String,Object> out)
Overrides:
addConfiguration in class CommonParserSettings<TsvFormat>


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