Class AbstractTableFilter

java.lang.Object
org.dbunit.dataset.filter.AbstractTableFilter
All Implemented Interfaces:
ITableFilter, ITableFilterSimple
Direct Known Subclasses:
DefaultTableFilter, ExcludeTableFilter, IncludeTableFilter, PrimaryKeyFilter

public abstract class AbstractTableFilter extends Object implements ITableFilter
This class provides a skeletal implementation of the ITableFilter interface to minimize the effort required to implement a filter. Subclasses are only required to implement the isValidName(java.lang.String) method.
Since:
2.2.0
Version:
$Revision$ $Date$
Author:
Manuel Laflamme, Last changed by: $Author$
  • Constructor Details

    • AbstractTableFilter

      public AbstractTableFilter()
  • Method Details

    • isValidName

      public abstract boolean isValidName(String tableName) throws DataSetException
      Returns true if specified table is allowed by this filter. This legacy method, now replaced by accept, still exist for compatibily with older environment
      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.
    • 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.