org.databene.benerator.composite
Class MutatingGeneratorProxy<E>

java.lang.Object
  extended by org.databene.benerator.util.AbstractGenerator<E>
      extended by org.databene.benerator.composite.MutatingGeneratorProxy<E>
All Implemented Interfaces:
java.io.Closeable, Generator<E>, Resettable, ThreadAware

public class MutatingGeneratorProxy<E>
extends AbstractGenerator<E>

Generates instances of an entity type as specified by its EntityDescriptor.

Created: 27.06.2007 23:51:42

Author:
Volker Bergmann

Field Summary
 
Fields inherited from class org.databene.benerator.util.AbstractGenerator
state
 
Constructor Summary
MutatingGeneratorProxy(java.lang.String instanceName, Generator<E> source, java.util.List<ComponentBuilder<E>> componentBuilders, Context context)
           
 
Method Summary
 void close()
          Closes the generator.
 E generate()
          Returns an instance of the generic type E.
 java.lang.Class<E> getGeneratedType()
          Declares the type of the objects returned by the generate() method.
 void init(GeneratorContext context)
           
 boolean isParallelizable()
           
 boolean isThreadSafe()
           
 void reset()
           
 java.lang.String toString()
           
 
Methods inherited from class org.databene.benerator.util.AbstractGenerator
assertInitialized, assertNotInitialized, wasInitialized
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MutatingGeneratorProxy

public MutatingGeneratorProxy(java.lang.String instanceName,
                              Generator<E> source,
                              java.util.List<ComponentBuilder<E>> componentBuilders,
                              Context context)
Parameters:
instanceName - instance name for the generated entities.
source - another Generator of entities that serves as Entity builder. It may construct empty Entities or may import them (so this may overwrite imported attributes).
componentBuilders - Generators that generate values for the entities' components
Method Detail

getGeneratedType

public java.lang.Class<E> getGeneratedType()
Description copied from interface: Generator
Declares the type of the objects returned by the generate() method.


init

public void init(GeneratorContext context)
Specified by:
init in interface Generator<E>
Overrides:
init in class AbstractGenerator<E>

generate

public E generate()
Description copied from interface: Generator
Returns an instance of the generic type E.


close

public void close()
Description copied from interface: Generator
Closes the generator. After invocation the state is unavailable.

Specified by:
close in interface java.io.Closeable
Specified by:
close in interface Generator<E>
Overrides:
close in class AbstractGenerator<E>

reset

public void reset()
Specified by:
reset in interface Resettable
Overrides:
reset in class AbstractGenerator<E>

toString

public java.lang.String toString()
Overrides:
toString in class AbstractGenerator<E>

isParallelizable

public boolean isParallelizable()

isThreadSafe

public boolean isThreadSafe()


Copyright © 2010. All Rights Reserved.