org.databene.benerator.util
Class ExpressionBasedGenerator<E>

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

public class ExpressionBasedGenerator<E>
extends ThreadSafeGenerator<E>

Evaluates an Expression on each call to generate() and returns its results.

Created: 27.03.2010 19:51:46

Since:
0.6.0
Author:
Volker Bergmann

Field Summary
 
Fields inherited from class org.databene.benerator.util.AbstractGenerator
context, state
 
Constructor Summary
ExpressionBasedGenerator(Expression<E> expression, java.lang.Class<E> generatedType)
           
 
Method Summary
 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.
 java.lang.String toString()
           
 
Methods inherited from class org.databene.benerator.util.ThreadSafeGenerator
isParallelizable, isThreadSafe
 
Methods inherited from class org.databene.benerator.util.AbstractGenerator
assertInitialized, assertNotInitialized, close, init, reset, wasInitialized
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ExpressionBasedGenerator

public ExpressionBasedGenerator(Expression<E> expression,
                                java.lang.Class<E> generatedType)
Method Detail

generate

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


getGeneratedType

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


toString

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


Copyright © 2010. All Rights Reserved.