Class DataSetProducerAdapter

java.lang.Object
org.dbunit.dataset.stream.DataSetProducerAdapter
All Implemented Interfaces:
IDataSetProducer

public class DataSetProducerAdapter extends Object implements IDataSetProducer
Implementation of IDataSetProducer based on a given IDataSet or a ITableIterator.
Since:
Apr 17, 2003
Version:
$Revision$ $Date$
Author:
Manuel Laflamme, Last changed by: $Author$
  • Constructor Details

    • DataSetProducerAdapter

      public DataSetProducerAdapter(ITableIterator iterator)
      Creates a producer that reports the tables of the given iterator.
      Parameters:
      iterator - the iterator providing the tables to produce.
    • DataSetProducerAdapter

      public DataSetProducerAdapter(IDataSet dataSet) throws DataSetException
      Creates a producer that reports the tables of the given dataset.
      Parameters:
      dataSet - the dataset providing the tables to produce.
      Throws:
      DataSetException - if the dataset's iterator cannot be created.
  • Method Details

    • setConsumer

      public void setConsumer(IDataSetConsumer consumer) throws DataSetException
      Description copied from interface: IDataSetProducer
      Sets the consumer notified of this producer's dataset content.
      Specified by:
      setConsumer in interface IDataSetProducer
      Parameters:
      consumer - the consumer to notify.
      Throws:
      DataSetException - if the consumer cannot be set.
    • produce

      public void produce() throws DataSetException
      Description copied from interface: IDataSetProducer
      Process this dataset source. During the processing, the IDataSetProducer will provide information about the dataset through the specified event listener.

      This method is synchronous: it will not return until processing has ended. If a client application wants to terminate parsing early, it should throw an exception from the listener.

      Specified by:
      produce in interface IDataSetProducer
      Throws:
      DataSetException - if processing the dataset source fails.