com.univocity.parsers.tsv
Class TsvWriterSettings

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

public class TsvWriterSettings
extends CommonWriterSettings<TsvFormat>

This is the configuration class used by the TSV writer (TsvWriter)

It does not offer additional configuration options on top of the ones provided by the CommonWriterSettings

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

Constructor Summary
TsvWriterSettings()
           
 
Method Summary
protected  void addConfiguration(Map<String,Object> out)
           
protected  TsvFormat createDefaultFormat()
          Returns the default TsvFormat.
 boolean isLineJoiningEnabled()
          Identifies whether values containing line endings should have the line separator written using the escape character (defined by TsvFormat.getEscapeChar() followed by the actual line separator character instead of other characters such as the standard letters 'n' and 'r' When line joining is disabled (the default), the TsvWriter will convert new line characters into sequences containing the escape character (typically '\') followed by characters 'n' or 'r'.
 void setLineJoiningEnabled(boolean lineJoiningEnabled)
          Defines how the writer should handle the escaping of line separators.
 
Methods inherited from class com.univocity.parsers.common.CommonWriterSettings
getEmptyValue, getExpandIncompleteRows, getRowWriterProcessor, isHeaderWritingEnabled, setEmptyValue, setExpandIncompleteRows, setHeaderWritingEnabled, setRowWriterProcessor
 
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

TsvWriterSettings

public TsvWriterSettings()
Method Detail

isLineJoiningEnabled

public boolean isLineJoiningEnabled()
Identifies whether values containing line endings should have the line separator written using the escape character (defined by TsvFormat.getEscapeChar() followed by the actual line separator character instead of other characters such as the standard letters 'n' and 'r' When line joining is disabled (the default), the TsvWriter will convert new line characters into sequences containing the escape character (typically '\') followed by characters 'n' or 'r'. No matter how many line separators the values written contain, the will be escaped and the entire output of a record will be written into a single line of text. For example, '\n' and '\r' characters will be written as: '\'+'n' and '\'+'r'. If line joining is enabled, the TsvWriter will convert line new line characters into sequences containing the escape character, followed by characters '\n', '\r' or both. A new line of text will be generated for each line separator found in the value to be written, "marking" the end of each line with the escape character to indicate the record continues on the next line. For example, '\n' and '\r' characters will be written as: '\'+'\n' and '\'+'\r'.

Returns:
true if line joining is enabled, otherwise false

setLineJoiningEnabled

public void setLineJoiningEnabled(boolean lineJoiningEnabled)
Defines how the writer should handle the escaping of line separators. Values containing line endings should be escaped and the line separator characters can be written using the escape character (defined by TsvFormat.getEscapeChar() followed by the actual line separator character instead of other characters such as the standard letters 'n' and 'r' When line joining is disabled (the default), the TsvWriter will convert new line characters into sequences containing the escape character (typically '\') followed by characters 'n' or 'r'. No matter how many line separators the values written contain, the will be escaped and the entire output of a record will be written into a single line of text. For example, '\n' and '\r' characters will be written as: '\'+'n' and '\'+'r'. If line joining is enabled, the TsvWriter will convert line new line characters into sequences containing the escape character, followed by characters '\n', '\r' or both. A new line of text will be generated for each line separator found in the value to be written, "marking" the end of each line with the escape character to indicate the record continues on the next line. For example, '\n' and '\r' characters will be written as: '\'+'\n' and '\'+'\r'.

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

createDefaultFormat

protected TsvFormat createDefaultFormat()
Returns the default TsvFormat.

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

addConfiguration

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


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