org.dbunit.dataset
Class CachedDataSet

java.lang.Object
  extended by org.dbunit.dataset.AbstractDataSet
      extended by org.dbunit.dataset.CachedDataSet
All Implemented Interfaces:
IDataSet, IDataSetConsumer
Direct Known Subclasses:
CsvDataSet, CsvURLDataSet, FlatXmlDataSet, SqlLoaderControlDataSet, XmlDataSet

public class CachedDataSet
extends AbstractDataSet
implements IDataSetConsumer

Hold copy of another dataset or a consumed provider content.

Since:
1.x (Apr 18, 2003)
Version:
$Revision: 941 $ $Date: 2009-01-16 16:42:11 +0100 (ven, 16 gen 2009) $
Author:
Manuel Laflamme, Last changed by: $Author: gommma $

Field Summary
 
Fields inherited from class org.dbunit.dataset.AbstractDataSet
_orderedTableNameMap
 
Constructor Summary
CachedDataSet()
          Default constructor.
CachedDataSet(IDataSet dataSet)
          Creates a copy of the specified dataset.
CachedDataSet(IDataSetProducer producer)
          Creates a CachedDataSet that synchronously consume the specified producer.
CachedDataSet(IDataSetProducer producer, boolean caseSensitiveTableNames)
          Creates a CachedDataSet that synchronously consume the specified producer.
 
Method Summary
protected  ITableIterator createIterator(boolean reversed)
          Creates an iterator which provides access to all tables of this dataset
 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
createTableNameMap, getTable, getTableMetaData, getTableNames, getTables, isCaseSensitiveTableNames, 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.

Throws:
DataSetException

CachedDataSet

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

Throws:
DataSetException

CachedDataSet

public CachedDataSet(IDataSetProducer producer,
                     boolean caseSensitiveTableNames)
              throws DataSetException
Creates a CachedDataSet that synchronously consume the specified producer.

Parameters:
producer -
caseSensitiveTableNames - Whether or not case sensitive table names should be used
Throws:
DataSetException
Method Detail

createIterator

protected ITableIterator createIterator(boolean reversed)
                                 throws DataSetException
Description copied from class: AbstractDataSet
Creates an iterator which provides access to all tables of this dataset

Specified by:
createIterator in class AbstractDataSet
Parameters:
reversed - Whether the created iterator should be a reversed one or not
Returns:
The created ITableIterator
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-2010. All Rights Reserved.