Package org.dbunit.dataset
Class AbstractDataSet
java.lang.Object
org.dbunit.dataset.AbstractDataSet
- All Implemented Interfaces:
IDataSet
- Direct Known Subclasses:
CachedDataSet,CaseInsensitiveDataSet,CompositeDataSet,DatabaseDataSet,DefaultDataSet,FilteredDataSet,FlatDtdDataSet,ForwardOnlyDataSet,LowerCaseDataSet,QueryDataSet,ReplacementDataSet,SortedDataSet,StreamingDataSet,TableDecoratorDataSet,XlsDataSet
This abstract class provides the basic implementation of the IDataSet
interface. Subclass are only required to implement the
createIterator(boolean)
method.- Since:
- 1.0 (Feb 22, 2002)
- Version:
- $Revision$ $Date$
- Author:
- Manuel Laflamme, Last changed by: $Author$
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected OrderedTableNameMapLazily-initialized map of this dataset's tables, keyed by table name. -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructorAbstractDataSet(boolean caseSensitiveTableNames) Constructor -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract ITableIteratorcreateIterator(boolean reversed) Creates an iterator which provides access to all tables of this datasetprotected OrderedTableNameMapCreates and returns a new instance of the table names container.Returns the specified table.getTableMetaData(String tableName) Returns the specified table metadata.String[]Returns names of tables in this dataset in proper sequence.ITable[]Returns tables in this dataset in proper sequence.protected voidInitializes the tables of this datasetbooleanWhether or not this dataset handles table names in a case sensitive way or not.iterator()Returns an iterator over the tables in this dataset in proper sequence.Returns an iterator over the tables in this dataset in reverse sequence.toString()
-
Field Details
-
_orderedTableNameMap
Lazily-initialized map of this dataset's tables, keyed by table name.
-
-
Constructor Details
-
AbstractDataSet
public AbstractDataSet()Default constructor -
AbstractDataSet
public AbstractDataSet(boolean caseSensitiveTableNames) Constructor- Parameters:
caseSensitiveTableNames- Whether or not table names should be case sensitive- Since:
- 2.4
-
-
Method Details
-
isCaseSensitiveTableNames
public boolean isCaseSensitiveTableNames()Description copied from interface:IDataSetWhether or not this dataset handles table names in a case sensitive way or not.- Specified by:
isCaseSensitiveTableNamesin interfaceIDataSet- Returns:
trueif the case sensitivity of table names is used in this dataset.- Since:
- 2.4
-
createTableNameMap
Creates and returns a new instance of the table names container. Implementors should use this method to retrieve a map which stores table names which can be linked with arbitrary objects.- Returns:
- a new empty instance of the table names container
- Since:
- 2.4
-
initialize
Initializes the tables of this dataset- Throws:
DataSetException- if the tables cannot be gathered, for example due to a duplicate table name.- Since:
- 2.4
-
createIterator
Creates an iterator which provides access to all tables of this dataset- 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.
-
getTableNames
Description copied from interface:IDataSetReturns names of tables in this dataset in proper sequence. Multiple occurrence of the same name may be returned if multiple tables having the same name are present in the dataset.- Specified by:
getTableNamesin interfaceIDataSet- Returns:
- the table names, in proper sequence.
- Throws:
DataSetException- if the table names cannot be determined.
-
getTableMetaData
Description copied from interface:IDataSetReturns the specified table metadata.- Specified by:
getTableMetaDatain interfaceIDataSet- Parameters:
tableName- the name of the table to look up.- Returns:
- the metadata of the specified table.
- Throws:
DataSetException
-
getTable
Description copied from interface:IDataSetReturns the specified table.- Specified by:
getTablein interfaceIDataSet- Parameters:
tableName- the name of the table to look up.- Returns:
- the specified table.
- Throws:
DataSetException
-
getTables
Description copied from interface:IDataSetReturns tables in this dataset in proper sequence. Multiple tables having the same name but different data may be returned.- Specified by:
getTablesin interfaceIDataSet- Returns:
- the tables in this dataset, in proper sequence.
- Throws:
DataSetException- if the tables cannot be determined.
-
iterator
Description copied from interface:IDataSetReturns an iterator over the tables in this dataset in proper sequence.- Specified by:
iteratorin interfaceIDataSet- Returns:
- an iterator over the tables in this dataset.
- Throws:
DataSetException- if the iterator cannot be created.
-
reverseIterator
Description copied from interface:IDataSetReturns an iterator over the tables in this dataset in reverse sequence.- Specified by:
reverseIteratorin interfaceIDataSet- Returns:
- an iterator over the tables in this dataset, in reverse sequence.
- Throws:
DataSetException- if the iterator cannot be created.
-
toString
-