Package org.dbunit.dataset.yaml
Class YamlProducer
java.lang.Object
org.dbunit.dataset.yaml.YamlProducer
- All Implemented Interfaces:
IDataSetProducer
IDataSetProducer that parses a YAML dataset document and streams
table/row events.- Version:
- $Revision$ $Date$
- Author:
- Björn Beskow
-
Constructor Summary
ConstructorsConstructorDescriptionYamlProducer(File file) Creates a producer reading YAML from the given file.YamlProducer(InputStream inputStream) Creates a producer reading YAML from the given stream. -
Method Summary
Modifier and TypeMethodDescriptionvoidproduce()Process this dataset source.voidsetConsumer(IDataSetConsumer consumer) Sets the consumer notified of this producer's dataset content.
-
Constructor Details
-
YamlProducer
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
Creates a producer reading YAML from the given stream.- Parameters:
inputStream- the stream to read YAML from.
-
-
Method Details
-
setConsumer
Description copied from interface:IDataSetProducerSets the consumer notified of this producer's dataset content.- Specified by:
setConsumerin interfaceIDataSetProducer- Parameters:
consumer- the consumer to notify.
-
produce
Description copied from interface:IDataSetProducerProcess 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:
producein interfaceIDataSetProducer- Throws:
DataSetException- if processing the dataset source fails.
-