Package com.univocity.parsers.tsv
Class TsvWriterSettings
java.lang.Object
com.univocity.parsers.common.CommonSettings<F>
com.univocity.parsers.common.CommonWriterSettings<TsvFormat>
com.univocity.parsers.tsv.TsvWriterSettings
- All Implemented Interfaces:
Cloneable
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
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
addConfiguration
(Map<String, Object> out) final TsvWriterSettings
clone()
Clones this configuration object.final TsvWriterSettings
clone
(boolean clearInputSpecificSettings) Clones this configuration object to reuse user-provided settings.protected TsvFormat
Returns the default TsvFormat.boolean
Identifies whether values containing line endings should have the line separator written using the escape character (defined byTsvFormat.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), theTsvWriter
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
clearInputSpecificSettings, configureFromAnnotations, getEmptyValue, getExpandIncompleteRows, getRowWriterProcessor, isColumnReorderingEnabled, isHeaderWritingEnabled, setColumnReorderingEnabled, 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, 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
-
TsvWriterSettings
public TsvWriterSettings()
-
-
Method Details
-
isLineJoiningEnabled
public boolean isLineJoiningEnabled()Identifies whether values containing line endings should have the line separator written using the escape character (defined byTsvFormat.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), theTsvWriter
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, theTsvWriter
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, otherwisefalse
-
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 byTsvFormat.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), theTsvWriter
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, theTsvWriter
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
Returns the default TsvFormat.- Specified by:
createDefaultFormat
in classCommonSettings<TsvFormat>
- Returns:
- and instance of TsvFormat configured to produce TSV outputs.
-
addConfiguration
- Overrides:
addConfiguration
in classCommonWriterSettings<TsvFormat>
-
clone
Description copied from class:CommonSettings
Clones 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:
clone
in classCommonWriterSettings<TsvFormat>
- Returns:
- a copy of all configurations applied to the current instance.
-
clone
Description copied from class:CommonSettings
Clones 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 theclearInputSpecificSettings
flag is set totrue
- Overrides:
clone
in classCommonWriterSettings<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.
-