org.dbunit.dataset
Class ReplacementDataSet

java.lang.Object
  extended byorg.dbunit.dataset.AbstractDataSet
      extended byorg.dbunit.dataset.ReplacementDataSet
All Implemented Interfaces:
IDataSet

public class ReplacementDataSet
extends AbstractDataSet

Decorator that replace configured values from the decorated dataset with replacement values.

Since:
Mar 17, 2003
Version:
$Revision: 1.6 $
Author:
Manuel Laflamme

Constructor Summary
ReplacementDataSet(IDataSet dataSet)
          Create a new ReplacementDataSet object that decorates the specified dataset.
ReplacementDataSet(IDataSet dataSet, java.util.Map objectMap, java.util.Map substringMap)
          Create a new ReplacementDataSet object that decorates the specified dataset.
 
Method Summary
 void addReplacementObject(java.lang.Object originalObject, java.lang.Object replacementObject)
          Add a new Object replacement mapping.
 void addReplacementSubstring(java.lang.String originalSubstring, java.lang.String replacementSubstring)
          Add a new substring replacement mapping.
protected  ITableIterator createIterator(boolean reversed)
           
 ITable getTable(java.lang.String tableName)
          Returns the specified table.
 ITableMetaData getTableMetaData(java.lang.String tableName)
          Returns the specified table metadata.
 java.lang.String[] getTableNames()
          Returns names of tables in this dataset in proper sequence.
 void setSubstringDelimiters(java.lang.String startDelimiter, java.lang.String endDelimiter)
          Sets substring delimiters.
 
Methods inherited from class org.dbunit.dataset.AbstractDataSet
cloneTables, getTables, iterator, reverseIterator, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ReplacementDataSet

public ReplacementDataSet(IDataSet dataSet)
Create a new ReplacementDataSet object that decorates the specified dataset.

Parameters:
dataSet - the decorated table

ReplacementDataSet

public ReplacementDataSet(IDataSet dataSet,
                          java.util.Map objectMap,
                          java.util.Map substringMap)
Create a new ReplacementDataSet object that decorates the specified dataset.

Parameters:
dataSet - the decorated dataset
objectMap - the replacement objects mapping
substringMap - the replacement substrings mapping
Method Detail

addReplacementObject

public void addReplacementObject(java.lang.Object originalObject,
                                 java.lang.Object replacementObject)
Add a new Object replacement mapping.

Parameters:
originalObject - the object to replace
replacementObject - the replacement object

addReplacementSubstring

public void addReplacementSubstring(java.lang.String originalSubstring,
                                    java.lang.String replacementSubstring)
Add a new substring replacement mapping.

Parameters:
originalSubstring - the substring to replace
replacementSubstring - the replacement substring

setSubstringDelimiters

public void setSubstringDelimiters(java.lang.String startDelimiter,
                                   java.lang.String endDelimiter)
Sets substring delimiters.


createIterator

protected ITableIterator createIterator(boolean reversed)
                                 throws DataSetException
Specified by:
createIterator in class AbstractDataSet
Throws:
DataSetException

getTableNames

public java.lang.String[] getTableNames()
                                 throws DataSetException
Description copied from interface: IDataSet
Returns names of tables in this dataset in proper sequence. Multiple occurence of the same name may be returned if multiple tables having the same name are present in the dataset.

Specified by:
getTableNames in interface IDataSet
Overrides:
getTableNames in class AbstractDataSet
Throws:
DataSetException

getTableMetaData

public ITableMetaData getTableMetaData(java.lang.String tableName)
                                throws DataSetException
Description copied from interface: IDataSet
Returns the specified table metadata.

Specified by:
getTableMetaData in interface IDataSet
Overrides:
getTableMetaData in class AbstractDataSet
Throws:
DataSetException

getTable

public ITable getTable(java.lang.String tableName)
                throws DataSetException
Description copied from interface: IDataSet
Returns the specified table.

Specified by:
getTable in interface IDataSet
Overrides:
getTable in class AbstractDataSet
Throws:
DataSetException


Copyright © 2002-2004 DbUnit.org. All Rights Reserved.