org.dbunit.dataset
Class CachedDataSet

java.lang.Object
  extended byorg.dbunit.dataset.AbstractDataSet
      extended byorg.dbunit.dataset.CachedDataSet
All Implemented Interfaces:
IDataSet, IDataSetConsumer
Direct Known Subclasses:
FlatXmlDataSet, XmlDataSet

public class CachedDataSet
extends AbstractDataSet
implements IDataSetConsumer

Hold copy of another dataset or a consumed provider content.

Since:
Apr 18, 2003
Version:
$Revision: 1.6 $
Author:
Manuel Laflamme

Constructor Summary
CachedDataSet()
          Default constructor.
CachedDataSet(IDataSet dataSet)
          Creates a copy of the specified dataset.
CachedDataSet(IDataSetProducer producer)
          Creates a CachedDataSet that syncronously consume the specified producer.
 
Method Summary
protected  ITableIterator createIterator(boolean reversed)
           
 void endDataSet()
          Receive notification of the end of a dataset.
 void endTable()
          Receive notification of the end of a table.
 void row(java.lang.Object[] values)
          Receive notification of a table row.
 void startDataSet()
          Receive notification of the beginning of a dataset.
 void startTable(ITableMetaData metaData)
          Receive notification of the beginning of a table.
 
Methods inherited from class org.dbunit.dataset.AbstractDataSet
cloneTables, getTable, getTableMetaData, getTableNames, getTables, iterator, reverseIterator, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CachedDataSet

public CachedDataSet()
Default constructor.


CachedDataSet

public CachedDataSet(IDataSet dataSet)
              throws DataSetException
Creates a copy of the specified dataset.


CachedDataSet

public CachedDataSet(IDataSetProducer producer)
              throws DataSetException
Creates a CachedDataSet that syncronously consume the specified producer.

Method Detail

createIterator

protected ITableIterator createIterator(boolean reversed)
                                 throws DataSetException
Specified by:
createIterator in class AbstractDataSet
Throws:
DataSetException

startDataSet

public void startDataSet()
                  throws DataSetException
Description copied from interface: IDataSetConsumer
Receive notification of the beginning of a dataset. This method is invoked only once, before any other methods in this interface.

Specified by:
startDataSet in interface IDataSetConsumer
Throws:
DataSetException

endDataSet

public void endDataSet()
                throws DataSetException
Description copied from interface: IDataSetConsumer
Receive notification of the end of a dataset. This method is invoked only once, and it will be the last method invoked in this interface.

Specified by:
endDataSet in interface IDataSetConsumer
Throws:
DataSetException

startTable

public void startTable(ITableMetaData metaData)
                throws DataSetException
Description copied from interface: IDataSetConsumer
Receive notification of the beginning of a table. This method is invoked at the beginning of every table in the dataset; there will be a corresponding IDataSetConsumer.endDataSet() event for every startTable event (even when the table is empty).

Specified by:
startTable in interface IDataSetConsumer
Parameters:
metaData - the table metadata
Throws:
DataSetException

endTable

public void endTable()
              throws DataSetException
Description copied from interface: IDataSetConsumer
Receive notification of the end of a table.

Specified by:
endTable in interface IDataSetConsumer
Throws:
DataSetException

row

public void row(java.lang.Object[] values)
         throws DataSetException
Description copied from interface: IDataSetConsumer
Receive notification of a table row. This method is invoked to report each row of a table.

Specified by:
row in interface IDataSetConsumer
Parameters:
values - The row values.
Throws:
DataSetException


Copyright © 2002-2004 DbUnit.org. All Rights Reserved.