|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.io.Writer
java.io.BufferedWriter
org.knime.base.node.io.csvwriter.CSVWriter
public class CSVWriter
Class to write a DataTable
to an output stream.
Field Summary |
---|
Fields inherited from class java.io.Writer |
---|
lock |
Constructor Summary | |
---|---|
CSVWriter(Writer writer)
Creates a new writer with default settings. |
|
CSVWriter(Writer writer,
FileWriterSettings settings)
Creates new instance which writes tables to the given writer class. |
Method Summary | |
---|---|
String |
getLastWarningMessage()
Returns a warning message from the last write action. |
protected FileWriterSettings |
getSettings()
|
boolean |
hasWarningMessage()
|
protected String |
quoteString(String data,
boolean isNumerical)
Returns a string that can be written out to the file that is treated (with respect to quotes) according to the current settings. |
protected String |
replaceAndQuote(String data)
Replaces the quote end pattern contained in the string and puts quotes around the string. |
protected String |
replaceSeparator(String data)
Derives a string from the input string that has all appearances of the separator replaced with the specified replacer string. |
void |
write(DataTable table,
ExecutionMonitor exec)
Writes table with current settings. |
Methods inherited from class java.io.BufferedWriter |
---|
close, flush, newLine, write, write, write |
Methods inherited from class java.io.Writer |
---|
append, append, append, write, write |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CSVWriter(Writer writer)
writer
- the writer to write the table to.public CSVWriter(Writer writer, FileWriterSettings settings)
writer
- to write tosettings
- the object holding all settings, influencing how data
tables are written to file.Method Detail |
---|
protected FileWriterSettings getSettings()
public void write(DataTable table, ExecutionMonitor exec) throws IOException, CanceledExecutionException
table
with current settings.
table
- the table to write to the fileexec
- an execution monitor where to check for canceled status and
report progress to. (In case of cancellation, the file will be
deleted.)
IOException
- if any related I/O error occurs
CanceledExecutionException
- if execution in exec
has been canceled
NullPointerException
- if table is null
protected String quoteString(String data, boolean isNumerical)
data
- the string to quote/replaceQuotes/notQuote/etc.isNumerical
- set true, if the data comes from a numerical data cell
protected String replaceAndQuote(String data)
data
- the string to examine and change
protected String replaceSeparator(String data)
data
- the string to examine and to replace the separator in.
public boolean hasWarningMessage()
public String getLastWarningMessage()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |