org.databene.benerator
Interface Consumer

All Superinterfaces:
java.io.Closeable, java.io.Flushable
All Known Subinterfaces:
FileExporter
All Known Implementing Classes:
AbstractConsumer, AddingConsumer, BadDataConsumer, ConsoleExporter, ConsumerChain, ConsumerMock, ConsumerProxy, CSVEntityExporter, DbUnitEntityExporter, FixedWidthEntityExporter, FlatFileEntityExporter, FormattingConsumer, JavaInvoker, ListConsumer, LoggingConsumer, MappingEntityConsumer, NoConsumer, NonClosingConsumerProxy, PerfTrackingConsumer, ScriptedEntityExporter, SQLEntityExporter, StorageSystemConsumer, StorageSystemInserter, StorageSystemUpdater, TextFileExporter, XLSEntityExporter, XMLEntityExporter

public interface Consumer
extends java.io.Flushable, java.io.Closeable

Abstraction of an object that consumes (possibly larger quantities of) objects. Consumation is a two-step process: For each object A to be consumed, Benerator first calls startConsuming(ProductWrapper), then finishConsuming(ProductWrapper) with a wrapper of this object:

        startConsuming(A);
        finishConsuming(A);
 
If an object A has a 'sub object' B, (defined via nested a >generate< statement), Benerator represents the recursion by the following invocation sequence:
        startConsuming(A);
        startConsuming(B);
        finishConsuming(B);
        finishConsuming(A);
 

Created: 01.02.2008 16:15:09

Since:
0.4.0
Author:
Volker Bergmann

Method Summary
 void close()
          When called, the implementor has to close and free all resources.
 void finishConsuming(ProductWrapper<?> wrapper)
          Starts consumption of an object.
 void flush()
          Is called by Benerator for advising the Consumer to finish processing of the objects consumed so far.
 void startConsuming(ProductWrapper<?> wrapper)
          Starts consumption of an object.
 

Method Detail

startConsuming

void startConsuming(ProductWrapper<?> wrapper)
Starts consumption of an object. For invocation details see the class documentation.


finishConsuming

void finishConsuming(ProductWrapper<?> wrapper)
Starts consumption of an object. For invocation details see the class documentation.


flush

void flush()
Is called by Benerator for advising the Consumer to finish processing of the objects consumed so far. In Benerator descriptor files, the flushing behavior is controlled by the pageSize attribute.

Specified by:
flush in interface java.io.Flushable

close

void close()
When called, the implementor has to close and free all resources. It will not receive any more calls.

Specified by:
close in interface java.io.Closeable


Copyright © 2013. All Rights Reserved.