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

public abstract class AbstractDataSet extends Object implements IDataSet
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 Details

    • _orderedTableNameMap

      protected OrderedTableNameMap _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: IDataSet
      Whether or not this dataset handles table names in a case sensitive way or not.
      Specified by:
      isCaseSensitiveTableNames in interface IDataSet
      Returns:
      true if the case sensitivity of table names is used in this dataset.
      Since:
      2.4
    • createTableNameMap

      protected OrderedTableNameMap 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

      protected void initialize() throws DataSetException
      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

      protected abstract ITableIterator createIterator(boolean reversed) throws DataSetException
      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

      public String[] getTableNames() throws DataSetException
      Description copied from interface: IDataSet
      Returns 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:
      getTableNames in interface IDataSet
      Returns:
      the table names, in proper sequence.
      Throws:
      DataSetException - if the table names cannot be determined.
    • getTableMetaData

      public ITableMetaData getTableMetaData(String tableName) throws DataSetException
      Description copied from interface: IDataSet
      Returns the specified table metadata.
      Specified by:
      getTableMetaData in interface IDataSet
      Parameters:
      tableName - the name of the table to look up.
      Returns:
      the metadata of the specified table.
      Throws:
      DataSetException
    • getTable

      public ITable getTable(String tableName) throws DataSetException
      Description copied from interface: IDataSet
      Returns the specified table.
      Specified by:
      getTable in interface IDataSet
      Parameters:
      tableName - the name of the table to look up.
      Returns:
      the specified table.
      Throws:
      DataSetException
    • getTables

      public ITable[] getTables() throws DataSetException
      Description copied from interface: IDataSet
      Returns tables in this dataset in proper sequence. Multiple tables having the same name but different data may be returned.
      Specified by:
      getTables in interface IDataSet
      Returns:
      the tables in this dataset, in proper sequence.
      Throws:
      DataSetException - if the tables cannot be determined.
    • iterator

      public ITableIterator iterator() throws DataSetException
      Description copied from interface: IDataSet
      Returns an iterator over the tables in this dataset in proper sequence.
      Specified by:
      iterator in interface IDataSet
      Returns:
      an iterator over the tables in this dataset.
      Throws:
      DataSetException - if the iterator cannot be created.
    • reverseIterator

      public ITableIterator reverseIterator() throws DataSetException
      Description copied from interface: IDataSet
      Returns an iterator over the tables in this dataset in reverse sequence.
      Specified by:
      reverseIterator in interface IDataSet
      Returns:
      an iterator over the tables in this dataset, in reverse sequence.
      Throws:
      DataSetException - if the iterator cannot be created.
    • toString

      public String toString()
      Overrides:
      toString in class Object