Class ReplacementTable

java.lang.Object
org.dbunit.dataset.ReplacementTable
All Implemented Interfaces:
ITable

public class ReplacementTable extends Object implements ITable
Decorator that replaces configured values from the decorated table with replacement values.
Since:
Mar 17, 2003
Version:
$Revision$
Author:
Manuel Laflamme
  • Constructor Details

    • ReplacementTable

      public ReplacementTable(ITable table)
      Create a new ReplacementTable object that decorates the specified table.
      Parameters:
      table - the decorated table
    • ReplacementTable

      public ReplacementTable(ITable table, Map objectMap, Map substringMap, String startDelimiter, String endDelimiter)
  • Method Details

    • setStrictReplacement

      public void setStrictReplacement(boolean strictReplacement)
      Setting this property to true indicates that when no replacement is found for a delimited substring the replacement will fail fast.
      Parameters:
      strictReplacement - true if replacement should be strict
    • addReplacementObject

      public void addReplacementObject(Object originalObject, Object replacementObject)
      Add a new Object replacement mapping.
      Parameters:
      originalObject - the object to replace
      replacementObject - the replacement object
    • addReplacementSubstring

      public void addReplacementSubstring(String originalSubstring, String replacementSubstring)
      Add a new substring replacement mapping.
      Parameters:
      originalSubstring - the substring to replace
      replacementSubstring - the replacement substring
    • setSubstringDelimiters

      public void setSubstringDelimiters(String startDelimiter, String endDelimiter)
      Sets substring delimiters.
    • 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 Object getValue(int row, 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
      Parameters:
      row - The row index, starting with 0
      column - The name of the column
      Returns:
      The value
      Throws:
      DataSetException
    • toString

      public String toString()
      Overrides:
      toString in class Object