org.dbunit.dataset
Class RowFilterTable

java.lang.Object
  extended by org.dbunit.dataset.RowFilterTable
All Implemented Interfaces:
IRowValueProvider, ITable

public class RowFilterTable
extends java.lang.Object
implements ITable, IRowValueProvider

Filters table rows by using arbitrary column values of the table to check if a row should be filtered or not.
Implemented as a decorator for ITable. See dbunit feature request at #1959771

Since:
2.3.0
Author:
gommma

Field Summary
 
Fields inherited from interface org.dbunit.dataset.ITable
NO_VALUE
 
Constructor Summary
RowFilterTable(ITable table, IRowFilter rowFilter)
          Creates a new ITable where some rows can be filtered out from the original table
 
Method Summary
 java.lang.Object getColumnValue(java.lang.String columnName)
          Returns the column value for the column with the given name of the currently processed row
 int getRowCount()
          Returns this table row count.
 ITableMetaData getTableMetaData()
          Returns this table metadata.
 java.lang.Object getValue(int row, java.lang.String column)
          Returns this table value for the specified row and column.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RowFilterTable

public RowFilterTable(ITable table,
                      IRowFilter rowFilter)
               throws DataSetException
Creates a new ITable where some rows can be filtered out from the original table

Parameters:
table - The table to be wrapped
rowFilter - The row filter that checks for every row whether or not it should be filtered
Throws:
DataSetException
Method Detail

getTableMetaData

public ITableMetaData getTableMetaData()
Description copied from interface: ITable
Returns this table metadata.

Specified by:
getTableMetaData in interface ITable

getRowCount

public int getRowCount()
Description copied from interface: ITable
Returns this table row count.

Specified by:
getRowCount in interface ITable

getValue

public java.lang.Object getValue(int row,
                                 java.lang.String column)
                          throws DataSetException
Description copied from interface: ITable
Returns this table value for the specified row and column.

Specified by:
getValue in interface ITable
Throws:
NoSuchColumnException - if specfied column name do not exist in this table
RowOutOfBoundsException - if specfied row is less than zero or equals or greater than getRowCount
DataSetException

getColumnValue

public java.lang.Object getColumnValue(java.lang.String columnName)
                                throws DataSetException
Returns the column value for the column with the given name of the currently processed row

Specified by:
getColumnValue in interface IRowValueProvider
Parameters:
columnName - The db column name for which the value should be provided (current row's value)
Returns:
The value of the given column in the current row
Throws:
DataSetException
See Also:
IRowValueProvider.getColumnValue(java.lang.String)


Copyright © 2002-2008. All Rights Reserved.