org.databene.benerator.consumer
Class AbstractConsumer

java.lang.Object
  extended by org.databene.benerator.consumer.AbstractConsumer
All Implemented Interfaces:
java.io.Closeable, java.io.Flushable, Consumer
Direct Known Subclasses:
AddingConsumer, ConsumerMock, DbUnitEntityExporter, FormattingConsumer, JavaInvoker, ListConsumer, LoggingConsumer, NoConsumer, StorageSystemConsumer, XMLEntityExporter

public abstract class AbstractConsumer
extends java.lang.Object
implements Consumer

Abstract implementation of the Consumer interface. Custom implementations should rather inherit from this class than implement the Consumer interface directly. This increases the chance to keep custom consumers compatible with future versions.

Created: 25.01.2008 22:37:42

Since:
0.4.0
Author:
Volker Bergmann

Constructor Summary
AbstractConsumer()
           
 
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 finishProductConsumption(java.lang.Object 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.
abstract  void startProductConsumption(java.lang.Object object)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AbstractConsumer

public AbstractConsumer()
Method Detail

startConsuming

public void startConsuming(ProductWrapper<?> wrapper)
Description copied from interface: Consumer
Starts consumption of an object. For invocation details see the class documentation.

Specified by:
startConsuming in interface Consumer

finishConsuming

public void finishConsuming(ProductWrapper<?> wrapper)
Description copied from interface: Consumer
Starts consumption of an object. For invocation details see the class documentation.

Specified by:
finishConsuming in interface Consumer

startProductConsumption

public abstract void startProductConsumption(java.lang.Object object)

finishProductConsumption

public void finishProductConsumption(java.lang.Object object)

flush

public void flush()
Description copied from interface: Consumer
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
Specified by:
flush in interface Consumer

close

public void close()
Description copied from interface: Consumer
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
Specified by:
close in interface Consumer

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2013. All Rights Reserved.