org.dbunit.dataset
Class FilteredDataSet

java.lang.Object
  extended byorg.dbunit.dataset.AbstractDataSet
      extended byorg.dbunit.dataset.FilteredDataSet
All Implemented Interfaces:
IDataSet

public class FilteredDataSet
extends AbstractDataSet

Decorates a dataset and exposes only some tables from it. Can be used with different filtering strategies.

Since:
Feb 22, 2002
Version:
$Revision: 1.18 $
Author:
Manuel Laflamme
See Also:
ITableFilter, SequenceTableFilter, DefaultTableFilter

Constructor Summary
FilteredDataSet(ITableFilter filter, IDataSet dataSet)
          Creates a FilteredDataSet that decorates the specified dataset and exposes only the tables allowed by the specified filter.
FilteredDataSet(java.lang.String[] tableNames, IDataSet dataSet)
          Creates a FilteredDataSet that decorates the specified dataset and exposes only the specified tables using SequenceTableFilter as filtering startegy.
 
Method Summary
protected  ITableIterator createIterator(boolean reversed)
           
 ITable getTable(java.lang.String tableName)
          Returns the specified table.
 ITableMetaData getTableMetaData(java.lang.String tableName)
          Returns the specified table metadata.
 java.lang.String[] getTableNames()
          Returns names of tables in this dataset in proper sequence.
 
Methods inherited from class org.dbunit.dataset.AbstractDataSet
cloneTables, getTables, iterator, reverseIterator, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FilteredDataSet

public FilteredDataSet(java.lang.String[] tableNames,
                       IDataSet dataSet)
Creates a FilteredDataSet that decorates the specified dataset and exposes only the specified tables using SequenceTableFilter as filtering startegy.


FilteredDataSet

public FilteredDataSet(ITableFilter filter,
                       IDataSet dataSet)
Creates a FilteredDataSet that decorates the specified dataset and exposes only the tables allowed by the specified filter.

Parameters:
dataSet - the filtered dataset
filter - the filtering strategy
Method Detail

createIterator

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

getTableNames

public java.lang.String[] getTableNames()
                                 throws DataSetException
Description copied from interface: IDataSet
Returns names of tables in this dataset in proper sequence. Multiple occurence 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
Overrides:
getTableNames in class AbstractDataSet
Throws:
DataSetException

getTableMetaData

public ITableMetaData getTableMetaData(java.lang.String tableName)
                                throws DataSetException
Description copied from interface: IDataSet
Returns the specified table metadata.

Specified by:
getTableMetaData in interface IDataSet
Overrides:
getTableMetaData in class AbstractDataSet
Throws:
DataSetException

getTable

public ITable getTable(java.lang.String tableName)
                throws DataSetException
Description copied from interface: IDataSet
Returns the specified table.

Specified by:
getTable in interface IDataSet
Overrides:
getTable in class AbstractDataSet
Throws:
DataSetException


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