Package org.dbunit.dataset.filter
Class DefaultColumnFilter
java.lang.Object
org.dbunit.dataset.filter.DefaultColumnFilter
- All Implemented Interfaces:
IColumnFilter
Implementation of the IColumnFilter interface that exposes columns matching
include patterns and not matching exclude patterns.
- Since:
- Apr 17, 2004
- Version:
- $Revision$
- Author:
- Manuel Laflamme
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanTests whether or not the specified column of the specified tableName should be included by this filter.voidexcludeColumn(String columnPattern) Add a new refused column name pattern for all tables.voidexcludeColumns(Column[] columns) Add specified columns to excluded column name list.static ITableexcludedColumnsTable(ITable table, String[] columnNames) Returns a table backed by the specified table but with specified columns excluded.static ITableexcludedColumnsTable(ITable table, Column[] columns) Returns a table backed by the specified table but with specified columns excluded.voidincludeColumn(String columnPattern) Add a new accepted column name pattern for all tables.voidincludeColumns(Column[] columns) Add specified columns to accepted column name list.static ITableincludedColumnsTable(ITable table, String[] columnNames) Returns a table backed by the specified table that only exposes specified columns.static ITableincludedColumnsTable(ITable table, Column[] columns) Returns a table backed by the specified table that only exposes specified columns.toString()
-
Constructor Details
-
DefaultColumnFilter
public DefaultColumnFilter()
-
-
Method Details
-
includeColumn
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
Add specified columns to accepted column name list.- Parameters:
columns- the columns to accept.
-
excludeColumn
Add a new refused 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 refused.
-
excludeColumns
Add specified columns to excluded column name list.- Parameters:
columns- the columns to exclude.
-
includedColumnsTable
public static ITable includedColumnsTable(ITable table, String[] columnNames) throws DataSetException Returns a table backed by the specified table that only exposes specified columns.- Parameters:
table- the table to filter.columnNames- the names of the columns to expose.- Returns:
- the filtered table.
- Throws:
DataSetException- if the filtered metadata cannot be built.
-
includedColumnsTable
Returns a table backed by the specified table that only exposes specified columns.- Parameters:
table- the table to filter.columns- the columns to expose.- Returns:
- the filtered table.
- Throws:
DataSetException- if the filtered metadata cannot be built.
-
excludedColumnsTable
public static ITable excludedColumnsTable(ITable table, String[] columnNames) throws DataSetException Returns a table backed by the specified table but with specified columns excluded.- Parameters:
table- the table to filter.columnNames- the names of the columns to exclude.- Returns:
- the filtered table.
- Throws:
DataSetException- if the filtered metadata cannot be built.
-
excludedColumnsTable
Returns a table backed by the specified table but with specified columns excluded.- Parameters:
table- the table to filter.columns- the columns to exclude.- Returns:
- the filtered table.
- Throws:
DataSetException- if the filtered metadata cannot be built.
-
accept
Description copied from interface:IColumnFilterTests whether or not the specified column of the specified tableName should be included by this filter.- Specified by:
acceptin interfaceIColumnFilter- Parameters:
tableName- The tableName to be testedcolumn- The column to be tested- Returns:
trueif and only if the given parameter set should be included
-
toString
-