org.dbunit.dataset.filter
Class DefaultColumnFilter

java.lang.Object
  extended by org.dbunit.dataset.filter.DefaultColumnFilter
All Implemented Interfaces:
IColumnFilter

public class DefaultColumnFilter
extends Object
implements IColumnFilter

Implementation of the IColumnFilter interface that exposes columns matching include patterns and not matching exclude patterns.

Since:
Apr 17, 2004
Version:
$Revision: 850 $
Author:
Manuel Laflamme

Constructor Summary
DefaultColumnFilter()
           
 
Method Summary
 boolean accept(String tableName, Column column)
          Tests whether or not the specified column of the specified tableName should be included by this filter.
 void excludeColumn(String columnPattern)
          Add a new refused column name pattern for all tables.
 void excludeColumns(Column[] columns)
          Add specified columns to excluded column name list.
static ITable excludedColumnsTable(ITable table, Column[] columns)
          Returns a table backed by the specified table but with specified columns excluded.
static ITable excludedColumnsTable(ITable table, String[] columnNames)
          Returns a table backed by the specified table but with specified columns excluded.
 void includeColumn(String columnPattern)
          Add a new accepted column name pattern for all tables.
 void includeColumns(Column[] columns)
          Add specified columns to accepted column name list.
static ITable includedColumnsTable(ITable table, Column[] columns)
          Returns a table backed by the specified table that only exposes specified columns.
static ITable includedColumnsTable(ITable table, String[] columnNames)
          Returns a table backed by the specified table that only exposes specified columns.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DefaultColumnFilter

public DefaultColumnFilter()
Method Detail

includeColumn

public void includeColumn(String columnPattern)
Add a new accepted column name pattern for all tables. The following wildcard characters are supported: '*' matches zero or more characters, '?' matches one character.

Parameters:
columnPattern - The column pattern to be supported

includeColumns

public void includeColumns(Column[] columns)
Add specified columns to accepted column name list.


excludeColumn

public void excludeColumn(String columnPattern)
Add a new refused column name pattern for all tables. The following wildcard characters are supported: '*' matches zero or more characters, '?' matches one character.


excludeColumns

public void excludeColumns(Column[] columns)
Add specified columns to excluded column name list.


includedColumnsTable

public static ITable includedColumnsTable(ITable table,
                                          String[] columnNames)
                                   throws DataSetException
Returns a table backed by the specified table that only exposes specified columns.

Throws:
DataSetException

includedColumnsTable

public static ITable includedColumnsTable(ITable table,
                                          Column[] columns)
                                   throws DataSetException
Returns a table backed by the specified table that only exposes specified columns.

Throws:
DataSetException

excludedColumnsTable

public static ITable excludedColumnsTable(ITable table,
                                          String[] columnNames)
                                   throws DataSetException
Returns a table backed by the specified table but with specified columns excluded.

Throws:
DataSetException

excludedColumnsTable

public static ITable excludedColumnsTable(ITable table,
                                          Column[] columns)
                                   throws DataSetException
Returns a table backed by the specified table but with specified columns excluded.

Throws:
DataSetException

accept

public boolean accept(String tableName,
                      Column column)
Description copied from interface: IColumnFilter
Tests whether or not the specified column of the specified tableName should be included by this filter.

Specified by:
accept in interface IColumnFilter
Parameters:
tableName - The tableName to be tested
column - The column to be tested
Returns:
true if and only if the given parameter set should be included

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2002-2012. All Rights Reserved.