Package org.dbunit.dataset.stream
Class BufferedConsumer
java.lang.Object
org.dbunit.dataset.stream.BufferedConsumer
- All Implemented Interfaces:
IDataSetConsumer
Implementation of
IDataSetConsumer which buffers all data
until the endDataSet() event occurs.
This provides the possibility to append new Columns on
the fly which is needed for the column sensing feature in
FlatXmlDataSet.- Since:
- 2.3.0
- Version:
- $Revision$ $Date$
- Author:
- gommma (gommma AT users.sourceforge.net), Last changed by: $Author$
-
Constructor Summary
ConstructorsConstructorDescriptionBufferedConsumer(IDataSetConsumer wrappedConsumer) Creates a consumer that buffers all data untilendDataSet(), then flushes it to the given wrapped consumer. -
Method Summary
Modifier and TypeMethodDescriptionvoidReceive notification of the end of a dataset.voidendTable()Receive notification of the end of a table.voidReceive notification of a table row.voidReceive notification of the beginning of a dataset.voidstartTable(ITableMetaData metaData) Receive notification of the beginning of a table.
-
Constructor Details
-
BufferedConsumer
Creates a consumer that buffers all data untilendDataSet(), then flushes it to the given wrapped consumer.- Parameters:
wrappedConsumer- The consumer that is wrapped
-
-
Method Details
-
startDataSet
Description copied from interface:IDataSetConsumerReceive notification of the beginning of a dataset. This method is invoked only once, before any other methods in this interface.- Specified by:
startDataSetin interfaceIDataSetConsumer- Throws:
DataSetException- if the notification cannot be processed.
-
endDataSet
Description copied from interface:IDataSetConsumerReceive notification of the end of a dataset. This method is invoked only once, and it will be the last method invoked in this interface.- Specified by:
endDataSetin interfaceIDataSetConsumer- Throws:
DataSetException- if the notification cannot be processed.
-
row
Description copied from interface:IDataSetConsumerReceive notification of a table row. This method is invoked to report each row of a table.- Specified by:
rowin interfaceIDataSetConsumer- Parameters:
values- The row values.- Throws:
DataSetException- if the notification cannot be processed.
-
startTable
Description copied from interface:IDataSetConsumerReceive notification of the beginning of a table. This method is invoked at the beginning of every table in the dataset; there will be a correspondingIDataSetConsumer.endDataSet()event for everystartTableevent (even when the table is empty).- Specified by:
startTablein interfaceIDataSetConsumer- Parameters:
metaData- the table metadata- Throws:
DataSetException- if the notification cannot be processed.
-
endTable
Description copied from interface:IDataSetConsumerReceive notification of the end of a table.- Specified by:
endTablein interfaceIDataSetConsumer- Throws:
DataSetException- if the notification cannot be processed.
-