Package org.dbunit.dataset.excel
Class XlsDataSet
java.lang.Object
org.dbunit.dataset.AbstractDataSet
org.dbunit.dataset.excel.XlsDataSet
- All Implemented Interfaces:
IDataSet
This dataset implementation can read and write MS Excel documents. Each
sheet represents a table. The first row of a sheet defines the columns names
and remaining rows contains the data.
- Since:
- Feb 21, 2003
- Version:
- $Revision$
- Author:
- Manuel Laflamme
-
Field Summary
Fields inherited from class org.dbunit.dataset.AbstractDataSet
_orderedTableNameMap -
Constructor Summary
ConstructorsConstructorDescriptionXlsDataSet(File file) Creates a new XlsDataSet object that loads the specified Excel document.Creates a new XlsDataSet object that loads the specified Excel document. -
Method Summary
Modifier and TypeMethodDescriptionprotected ITableIteratorcreateIterator(boolean reversed) Creates an iterator which provides access to all tables of this datasetstatic voidwrite(IDataSet dataSet, OutputStream out) Write the specified dataset to the specified Excel document.Methods inherited from class org.dbunit.dataset.AbstractDataSet
createTableNameMap, getTable, getTableMetaData, getTableNames, getTables, initialize, isCaseSensitiveTableNames, iterator, reverseIterator, toString
-
Constructor Details
-
XlsDataSet
Creates a new XlsDataSet object that loads the specified Excel document.- Parameters:
file- the Excel document to load.- Throws:
IOException- if the file cannot be read.DataSetException- if the document cannot be parsed.
-
XlsDataSet
Creates a new XlsDataSet object that loads the specified Excel document.- Parameters:
in- the Excel document to load.- Throws:
IOException- if the stream cannot be read.DataSetException- if the document cannot be parsed.
-
-
Method Details
-
write
Write the specified dataset to the specified Excel document.- Parameters:
dataSet- the dataset to write.out- the stream to write the Excel document to.- Throws:
IOException- if writing to the stream fails.DataSetException- if the dataset cannot be read.
-
createIterator
Description copied from class:AbstractDataSetCreates an iterator which provides access to all tables of this dataset- Specified by:
createIteratorin classAbstractDataSet- Parameters:
reversed- Whether the created iterator should be a reversed one or not- Returns:
- The created
ITableIterator - Throws:
DataSetException- if the iterator cannot be created.
-