org.databene.benerator.consumer
Class ConsumerChain

java.lang.Object
  extended by org.databene.benerator.consumer.ConsumerChain
All Implemented Interfaces:
java.io.Closeable, java.io.Flushable, Consumer

public class ConsumerChain
extends java.lang.Object
implements Consumer

Combines several Processors under one Processor interface. Each call to the Processor is forwarded to all sub Processors.

Created: 26.08.2007 14:50:29

Since:
0.4.0
Author:
Volker Bergmann

Constructor Summary
ConsumerChain(Consumer... components)
           
 
Method Summary
 void addComponent(Consumer component)
           
 void close()
          When called, the implementor has to close and free all resources.
 int componentCount()
           
 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.
 Consumer getComponent(int index)
           
 java.util.List<Consumer> getComponents()
           
 void setComponents(Consumer... components)
           
 void startConsuming(ProductWrapper<?> wrapper)
          Starts consumption of an object.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ConsumerChain

public ConsumerChain(Consumer... components)
Method Detail

setComponents

public void setComponents(Consumer... components)

addComponent

public void addComponent(Consumer component)

getComponent

public Consumer getComponent(int index)

componentCount

public int componentCount()

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

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

getComponents

public java.util.List<Consumer> getComponents()

toString

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


Copyright © 2013. All Rights Reserved.