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

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

public class VariableAwareGenerator<E>
extends java.lang.Object
implements Generator<E>

Encapsulates variables, entity generator and context behind a Generator interface.

Created: 30.01.2008 20:45:21

Since:
0.4.0
Author:
Volker Bergmann

Constructor Summary
VariableAwareGenerator(Generator<E> realGenerator, java.util.Map<java.lang.String,NullableGenerator<?>> variables, 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()
           
 boolean wasInitialized()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

VariableAwareGenerator

public VariableAwareGenerator(Generator<E> realGenerator,
                              java.util.Map<java.lang.String,NullableGenerator<?>> variables,
                              Context context)
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.

Specified by:
getGeneratedType in interface Generator<E>

init

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

wasInitialized

public boolean wasInitialized()
Specified by:
wasInitialized in interface Generator<E>

generate

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

Specified by:
generate in interface Generator<E>

reset

public void reset()
Specified by:
reset in interface Resettable

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>

toString

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

isParallelizable

public boolean isParallelizable()
Specified by:
isParallelizable in interface ThreadAware

isThreadSafe

public boolean isThreadSafe()
Specified by:
isThreadSafe in interface ThreadAware


Copyright © 2010. All Rights Reserved.