public class CsvDataSetWriter extends java.lang.Object implements IDataSetConsumer
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
NULL
todo: customizable separators (field, lines), manage the writers opened for each table
|
| Constructor and Description |
|---|
CsvDataSetWriter(java.io.File theDirectory) |
CsvDataSetWriter(java.lang.String theDirectory) |
| Modifier and Type | Method and Description |
|---|---|
void |
endDataSet()
Receive notification of the end of a dataset.
|
void |
endTable()
Receive notification of the end of a table.
|
protected static java.lang.String |
escape(java.lang.String stringValue) |
protected void |
finalize() |
java.lang.String |
getTheDirectory() |
java.io.Writer |
getWriter() |
void |
row(java.lang.Object[] values)
Receive notification of a table row.
|
void |
setTheDirectory(java.lang.String theDirectory) |
void |
setWriter(java.io.Writer writer) |
void |
startDataSet()
Receive notification of the beginning of a dataset.
|
void |
startTable(ITableMetaData metaData)
Receive notification of the beginning of a table.
|
void |
write(IDataSet dataSet) |
static void |
write(IDataSet dataset,
java.io.File dest) |
public static final java.lang.String NULL
public CsvDataSetWriter(java.lang.String theDirectory)
public CsvDataSetWriter(java.io.File theDirectory)
public void write(IDataSet dataSet) throws DataSetException
DataSetExceptionpublic void startDataSet()
throws DataSetException
IDataSetConsumerstartDataSet in interface IDataSetConsumerDataSetExceptionpublic void endDataSet()
throws DataSetException
IDataSetConsumerendDataSet in interface IDataSetConsumerDataSetExceptionpublic void startTable(ITableMetaData metaData) throws DataSetException
IDataSetConsumerIDataSetConsumer.endDataSet() event for every startTable
event (even when the table is empty).startTable in interface IDataSetConsumermetaData - the table metadataDataSetExceptionpublic void endTable()
throws DataSetException
IDataSetConsumerendTable in interface IDataSetConsumerDataSetExceptionpublic void row(java.lang.Object[] values)
throws DataSetException
IDataSetConsumerrow in interface IDataSetConsumervalues - The row values.DataSetExceptionprotected static java.lang.String escape(java.lang.String stringValue)
public java.io.Writer getWriter()
public void setWriter(java.io.Writer writer)
public java.lang.String getTheDirectory()
public void setTheDirectory(java.lang.String theDirectory)
public static void write(IDataSet dataset, java.io.File dest) throws DataSetException
DataSetExceptionprotected void finalize()
throws java.lang.Throwable
finalize in class java.lang.Objectjava.lang.ThrowableCopyright © 2002-2018. All Rights Reserved.