public class FileWriterSettings extends Object
Modifier and Type | Class and Description |
---|---|
static class |
FileWriterSettings.LineEnding
Mode specifying how to end a line in the file written.
|
static class |
FileWriterSettings.quoteMode
mode specifying how to quote the data.
|
Constructor and Description |
---|
FileWriterSettings()
Creates a settings object with default settings (backward compatible to
the old CSV writer).
|
FileWriterSettings(FileWriterSettings settings)
Creates a copy of the specified settings object.
|
FileWriterSettings(NodeSettingsRO settings)
Constructs a new object reading the settings from the specified
NodeSettings object.
|
Modifier and Type | Method and Description |
---|---|
static String |
escapeString(String str)
Returns a string with all TABS and newLines being replaced by "\t" or
"\n" - and backslashes replaced by "\\".
|
String |
getCharacterEncoding()
Character set - or null if default encoding should be used.
|
String |
getColSeparator() |
(package private) char |
getDecimalSeparator() |
FileWriterSettings.LineEnding |
getLineEndingMode() |
String |
getMissValuePattern() |
String |
getQuoteBegin() |
String |
getQuoteEnd() |
FileWriterSettings.quoteMode |
getQuoteMode() |
String |
getQuoteReplacement() |
String |
getSeparatorReplacement() |
boolean |
replaceSeparatorInStrings() |
void |
saveSettingsTo(NodeSettingsWO settings)
Saves the current values (even if they are incomplete or invalid) in the
specified settings object.
|
void |
setCharacterEncoding(String charSet)
The new char set - can be null indicating default encoding.
|
void |
setColSeparator(String colSeparator) |
(package private) void |
setDecimalSeparator(char newSeparator)
Sets a new decimal separator character.
|
void |
setLineEndingMode(FileWriterSettings.LineEnding mode)
Set a new line ending mode.
|
void |
setMissValuePattern(String missValuePattern) |
void |
setQuoteBegin(String quoteBegin) |
void |
setQuoteEnd(String quoteEnd) |
void |
setQuoteMode(FileWriterSettings.quoteMode quoteMode) |
void |
setQuoteReplacement(String quoteReplacement) |
void |
setReplaceSeparatorInStrings(boolean replaceSepInStrings) |
void |
setSeparatorReplacement(String separatorReplacement) |
void |
setWriteColumnHeader(boolean writeColumnHeader) |
void |
setWriteRowID(boolean writeRowID) |
static String |
unescapeString(String str)
takes a string that could contain "\t", or "\n", or "\\", and returns a
corresponding string with these patterns replaced by the characters '\t',
'\n', '\'.
|
boolean |
writeColumnHeader() |
boolean |
writeRowID() |
public FileWriterSettings()
public FileWriterSettings(FileWriterSettings settings)
settings
- the settings to copy into the new object.public FileWriterSettings(NodeSettingsRO settings) throws InvalidSettingsException
settings
- the object to read the initial values from.InvalidSettingsException
- if the settings object contains
incomplete, invalid, or inconsistent values.public void saveSettingsTo(NodeSettingsWO settings)
settings
- the object to write the current values to.public String getColSeparator()
public void setColSeparator(String colSeparator)
colSeparator
- the string that is written our between data items.public String getMissValuePattern()
public void setMissValuePattern(String missValuePattern)
missValuePattern
- the string that is written out for data cells
with missing values.public String getQuoteBegin()
public void setQuoteBegin(String quoteBegin)
quoteBegin
- the string that is used as opening quotation mark.public String getQuoteEnd()
public void setQuoteEnd(String quoteEnd)
quoteEnd
- the string used as closing quotation mark.public FileWriterSettings.quoteMode getQuoteMode()
public void setQuoteMode(FileWriterSettings.quoteMode quoteMode)
quoteMode
- the quoteMode to setpublic String getSeparatorReplacement()
public void setSeparatorReplacement(String separatorReplacement)
separatorReplacement
- the separatorReplacement to setpublic boolean replaceSeparatorInStrings()
public void setReplaceSeparatorInStrings(boolean replaceSepInStrings)
replaceSepInStrings
- if set true, the column separator will be
replaced in non-numerical columns - even if the data item written was
quoted.public boolean writeColumnHeader()
public void setWriteColumnHeader(boolean writeColumnHeader)
writeColumnHeader
- the writeColumnHeader to setpublic boolean writeRowID()
public void setWriteRowID(boolean writeRowID)
writeRowID
- the writeRowID to setpublic String getQuoteReplacement()
public void setQuoteReplacement(String quoteReplacement)
quoteReplacement
- the quoteReplacement to setchar getDecimalSeparator()
void setDecimalSeparator(char newSeparator)
newSeparator
- the new decimal separatorpublic FileWriterSettings.LineEnding getLineEndingMode()
public void setLineEndingMode(FileWriterSettings.LineEnding mode)
mode
- to setpublic String getCharacterEncoding()
public void setCharacterEncoding(String charSet)
charSet
- or null.public static String unescapeString(String str)
str
- a string with escape sequences in
KNIME GmbH, Konstanz, Germany
You may not modify, publish, transmit, transfer or sell, reproduce, create derivative works from, distribute, perform, display, or in any way exploit any of the content, in whole or in part, except as otherwise expressly permitted in writing by the copyright owner or as specified in the license file distributed with this product.