org.dbunit.dataset.filter
Class SequenceTableFilter

java.lang.Object
  extended by org.dbunit.dataset.filter.SequenceTableFilter
All Implemented Interfaces:
ITableFilter
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: 911 $ $Date: 2008-12-05 22:28:45 +0100 (Fri, 05 Dec 2008) $
Author:
Manuel Laflamme, Last changed by: $Author: gommma $

Constructor Summary
SequenceTableFilter(String[] tableNames)
          Creates a new SequenceTableFilter with specified table names sequence.
SequenceTableFilter(String[] tableNames, boolean caseSensitiveTableNames)
          Creates a new SequenceTableFilter with specified table names sequence.
 
Method Summary
 boolean accept(String tableName)
          Returns true if specified table is allowed by this filter.
 String[] getTableNames(IDataSet dataSet)
          Returns the table names allowed by this filter from the specified dataset.
 ITableIterator iterator(IDataSet dataSet, boolean reversed)
          Returns iterator of tables allowed by this filter from the specified dataset.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SequenceTableFilter

public SequenceTableFilter(String[] tableNames)
                    throws AmbiguousTableNameException
Creates a new SequenceTableFilter with specified table names sequence.

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 -
caseSensitiveTableNames -
Throws:
AmbiguousTableNameException - If the given array contains ambiguous names
Since:
2.4.2
Method Detail

accept

public boolean accept(String tableName)
               throws DataSetException
Description copied from interface: ITableFilter
Returns true if specified table is allowed by this filter.

Specified by:
accept in interface ITableFilter
Throws:
DataSetException

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
Throws:
DataSetException

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
Throws:
DataSetException

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2002-2012. All Rights Reserved.