Class SequenceTableFilter

java.lang.Object
org.dbunit.dataset.filter.SequenceTableFilter
All Implemented Interfaces:
ITableFilter, ITableFilterSimple
Direct Known Subclasses:
DatabaseSequenceFilter

public class SequenceTableFilter extends Object implements ITableFilter
This filter expose a specified table sequence and can be used to reorder tables in a dataset. This implementation does not support duplicate table names. Thus you cannot specify the same table name more than once in this filter and the filtered dataset must not contains duplicate table names. This is the default filter used by the FilteredDataSet.
Since:
Mar 7, 2003
Version:
$Revision$ $Date$
Author:
Manuel Laflamme, Last changed by: $Author$
  • Constructor Details

    • SequenceTableFilter

      public SequenceTableFilter(String[] tableNames) throws AmbiguousTableNameException
      Creates a new SequenceTableFilter with specified table names sequence.
      Parameters:
      tableNames - the table names, in the sequence they should be exposed.
      Throws:
      AmbiguousTableNameException - If the given array contains ambiguous names
    • SequenceTableFilter

      public SequenceTableFilter(String[] tableNames, boolean caseSensitiveTableNames) throws AmbiguousTableNameException
      Creates a new SequenceTableFilter with specified table names sequence.
      Parameters:
      tableNames - the table names, in the sequence they should be exposed.
      caseSensitiveTableNames - whether table names are handled in a case sensitive way.
      Throws:
      AmbiguousTableNameException - If the given array contains ambiguous names
      Since:
      2.4.2
  • Method Details

    • accept

      public boolean accept(String tableName) throws DataSetException
      Description copied from interface: ITableFilterSimple
      Returns true if specified table is allowed by this filter.
      Specified by:
      accept in interface ITableFilterSimple
      Parameters:
      tableName - the name of the table to check.
      Returns:
      true if specified table is allowed by this filter.
      Throws:
      DataSetException - if the check fails.
    • getTableNames

      public String[] getTableNames(IDataSet dataSet) throws DataSetException
      Description copied from interface: ITableFilter
      Returns the table names allowed by this filter from the specified dataset.
      Specified by:
      getTableNames in interface ITableFilter
      Parameters:
      dataSet - the filtered dataset
      Returns:
      the table names allowed by this filter.
      Throws:
      DataSetException - if retrieving the table names fails.
    • iterator

      public ITableIterator iterator(IDataSet dataSet, boolean reversed) throws DataSetException
      Description copied from interface: ITableFilter
      Returns iterator of tables allowed by this filter from the specified dataset.
      Specified by:
      iterator in interface ITableFilter
      Parameters:
      dataSet - the filtered dataset
      reversed - true to iterate in reverse order.
      Returns:
      the iterator of tables allowed by this filter.
      Throws:
      DataSetException - if creating the iterator fails.
    • toString

      public String toString()
      Overrides:
      toString in class Object