org.databene.benerator.util
Class GeneratorUtil

java.lang.Object
  extended by org.databene.benerator.util.GeneratorUtil

public class GeneratorUtil
extends java.lang.Object

Provides utility methods for data generation.

Created: 19.11.2007 15:27:50

Author:
Volker Bergmann

Constructor Summary
GeneratorUtil()
           
 
Method Summary
static
<T> java.util.List<T>
allProducts(Generator<T> generator)
           
static void close(Generator<?> generator)
           
static
<T> java.lang.Class<T>
commonTargetTypeOf(Generator<T>... sources)
           
static
<T> T
generateNonNull(Generator<T> generator)
          Calls a Generator's Generator.generate(ProductWrapper) method and returns its unwrapped result, signaling generator unavailability with a null value and requiring the Generator not to create null values as result.
static
<T> T
generateNullable(Generator<T> generator)
          Calls a Generator's Generator.generate(ProductWrapper) method and returns its unwrapped result, allowing null values as generation results, but requiring the generator to be available.
protected static
<T> ProductWrapper<T>
getWrapper()
           
static void init(Generator<?> generator)
           
static void init(Generator<?> generator, GeneratorContext context)
           
static void initAll(Generator<?>[] generators, GeneratorContext context)
           
static void resetAll(org.databene.commons.Resettable[] resettables)
           
static Generator<?> unwrap(Generator<?> generator)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GeneratorUtil

public GeneratorUtil()
Method Detail

init

public static void init(Generator<?> generator)

init

public static void init(Generator<?> generator,
                        GeneratorContext context)

close

public static void close(Generator<?> generator)

generateNullable

public static <T> T generateNullable(Generator<T> generator)
Calls a Generator's Generator.generate(ProductWrapper) method and returns its unwrapped result, allowing null values as generation results, but requiring the generator to be available.


generateNonNull

public static <T> T generateNonNull(Generator<T> generator)
Calls a Generator's Generator.generate(ProductWrapper) method and returns its unwrapped result, signaling generator unavailability with a null value and requiring the Generator not to create null values as result.


getWrapper

protected static <T> ProductWrapper<T> getWrapper()

allProducts

public static <T> java.util.List<T> allProducts(Generator<T> generator)

commonTargetTypeOf

public static <T> java.lang.Class<T> commonTargetTypeOf(Generator<T>... sources)

initAll

public static void initAll(Generator<?>[] generators,
                           GeneratorContext context)

resetAll

public static void resetAll(org.databene.commons.Resettable[] resettables)

unwrap

public static Generator<?> unwrap(Generator<?> generator)


Copyright © 2013. All Rights Reserved.