Class YamlProducer

java.lang.Object
org.dbunit.dataset.yaml.YamlProducer
All Implemented Interfaces:
IDataSetProducer

public class YamlProducer extends Object implements IDataSetProducer
IDataSetProducer that parses a YAML dataset document and streams table/row events.
Version:
$Revision$ $Date$
Author:
Björn Beskow
  • Constructor Details

    • YamlProducer

      public YamlProducer(File file) throws IOException
      Creates a producer reading YAML from the given file.
      Parameters:
      file - the YAML file to read.
      Throws:
      IOException - if the file cannot be opened.
    • YamlProducer

      public YamlProducer(InputStream inputStream)
      Creates a producer reading YAML from the given stream.
      Parameters:
      inputStream - the stream to read YAML from.
  • Method Details

    • setConsumer

      public void setConsumer(IDataSetConsumer consumer)
      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.
    • 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.