Class DefaultColumnFilter

java.lang.Object
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$
Author:
Manuel Laflamme
  • Constructor Details

    • DefaultColumnFilter

      public DefaultColumnFilter()
  • Method Details

    • 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