Package com.univocity.parsers.tsv
Class TsvParserSettings
java.lang.Object
com.univocity.parsers.common.CommonSettings<F>
com.univocity.parsers.common.CommonParserSettings<TsvFormat>
com.univocity.parsers.tsv.TsvParserSettings
- All Implemented Interfaces:
Cloneable
This is the configuration class used by the TSV parser (
TsvParser)
It supports the configuration options provided by CommonParserSettings only
- See Also:
-
Field Summary
FieldsFields inherited from class com.univocity.parsers.common.CommonParserSettings
headerExtractionEnabled -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddConfiguration(Map<String, Object> out) final TsvParserSettingsclone()Clones this configuration object.final TsvParserSettingsclone(boolean clearInputSpecificSettings) Clones this configuration object to reuse user-provided settings.protected TsvFormatReturns the default TsvFormat configured to handle TSV inputsbooleanIdentifies whether or lines ending with the escape character (defined byTsvFormat.getEscapeChar()and followed by a line separator character should be joined with the following line.voidsetLineJoiningEnabled(boolean lineJoiningEnabled) Defines how the parser should handle escaped line separators.Methods inherited from class com.univocity.parsers.common.CommonParserSettings
addInputAnalysisProcess, clearInputSpecificSettings, configureFromAnnotations, getInputAnalysisProcesses, getInputBufferSize, getNumberOfRecordsToRead, getNumberOfRowsToSkip, getProcessor, getReadInputOnSeparateThread, getRowProcessor, isAutoClosingEnabled, isColumnReorderingEnabled, isCommentCollectionEnabled, isCommentProcessingEnabled, isHeaderExtractionEnabled, isLineSeparatorDetectionEnabled, newCharAppender, newCharInputReader, setAutoClosingEnabled, setColumnReorderingEnabled, setCommentCollectionEnabled, setCommentProcessingEnabled, setHeaderExtractionEnabled, setInputBufferSize, setLineSeparatorDetectionEnabled, setNumberOfRecordsToRead, setNumberOfRowsToSkip, setProcessor, setReadInputOnSeparateThread, setRowProcessorMethods inherited from class com.univocity.parsers.common.CommonSettings
excludeFields, excludeFields, excludeIndexes, getErrorContentLength, getFormat, getHeaders, getIgnoreLeadingWhitespaces, getIgnoreTrailingWhitespaces, getMaxCharsPerColumn, getMaxColumns, getNullValue, getProcessorErrorHandler, getRowProcessorErrorHandler, getSkipBitsAsWhitespace, getSkipEmptyLines, getWhitespaceRangeStart, isAutoConfigurationEnabled, isProcessorErrorHandlerDefined, selectFields, selectFields, selectIndexes, setAutoConfigurationEnabled, setErrorContentLength, setFormat, setHeaders, setIgnoreLeadingWhitespaces, setIgnoreTrailingWhitespaces, setMaxCharsPerColumn, setMaxColumns, setNullValue, setProcessorErrorHandler, setRowProcessorErrorHandler, setSkipBitsAsWhitespace, setSkipEmptyLines, toString, trimValues
-
Field Details
-
lineJoiningEnabled
private boolean lineJoiningEnabled
-
-
Constructor Details
-
TsvParserSettings
public TsvParserSettings()
-
-
Method Details
-
isLineJoiningEnabled
public boolean isLineJoiningEnabled()Identifies whether or lines ending with the escape character (defined byTsvFormat.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), theTsvParserconverts 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, theTsvParserwill 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:
trueif line joining is enabled, otherwisefalse
-
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 byTsvFormat.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), theTsvParserconverts 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, theTsvParserwill 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
Returns the default TsvFormat configured to handle TSV inputs- Specified by:
createDefaultFormatin classCommonSettings<TsvFormat>- Returns:
- and instance of TsvFormat configured to handle TSV
-
addConfiguration
- Overrides:
addConfigurationin classCommonParserSettings<TsvFormat>
-
clone
Description copied from class:CommonSettingsClones this configuration object. Use alternativeCommonSettings.clone(boolean)method to reset properties that are specific to a given input, such as header names and selection of fields.- Overrides:
clonein classCommonParserSettings<TsvFormat>- Returns:
- a copy of all configurations applied to the current instance.
-
clone
Description copied from class:CommonSettingsClones this configuration object to reuse user-provided settings. Properties that are specific to a given input (such as header names and selection of fields) can be reset to their defaults if theclearInputSpecificSettingsflag is set totrue- Overrides:
clonein classCommonParserSettings<TsvFormat>- Parameters:
clearInputSpecificSettings- flag indicating whether to clear settings that are likely to be associated with a given input.- Returns:
- a copy of the configurations applied to the current instance.
-