org.databene.benerator.nullable
Class NullInjectingGeneratorWrapper<E>

java.lang.Object
  extended by org.databene.benerator.nullable.AbstractNullableGenerator<E>
      extended by org.databene.benerator.nullable.NullInjectingGeneratorWrapper<E>
All Implemented Interfaces:
java.io.Closeable, NullableGenerator<E>, org.databene.commons.Resettable, org.databene.commons.ThreadAware

public class NullInjectingGeneratorWrapper<E>
extends AbstractNullableGenerator<E>

Proxy implementation of the NullableGenerator interface.

Created: 26.01.2010 10:32:58

Since:
0.6.0
Author:
Volker Bergmann

Field Summary
 
Fields inherited from class org.databene.benerator.nullable.AbstractNullableGenerator
state
 
Constructor Summary
NullInjectingGeneratorWrapper(Generator<E> source, double nullQuota)
           
 
Method Summary
 void close()
           
 ProductWrapper<E> generate(ProductWrapper<E> wrapper)
          First checks if a null value should be returned, if so it returns a wrapper that wraps a null value, otherwise a wrapper that wraps a value generated by the underlying source generator.
 java.lang.Class<E> getGeneratedType()
           
 void init(GeneratorContext context)
           
 boolean isParallelizable()
           
 boolean isThreadSafe()
           
 void reset()
           
 java.lang.String toString()
           
 
Methods inherited from class org.databene.benerator.nullable.AbstractNullableGenerator
assertInitialized, assertNotInitialized
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NullInjectingGeneratorWrapper

public NullInjectingGeneratorWrapper(Generator<E> source,
                                     double nullQuota)
Method Detail

getGeneratedType

public java.lang.Class<E> getGeneratedType()

init

public void init(GeneratorContext context)
          throws InvalidGeneratorSetupException
Specified by:
init in interface NullableGenerator<E>
Overrides:
init in class AbstractNullableGenerator<E>
Throws:
InvalidGeneratorSetupException

generate

public ProductWrapper<E> generate(ProductWrapper<E> wrapper)
First checks if a null value should be returned, if so it returns a wrapper that wraps a null value, otherwise a wrapper that wraps a value generated by the underlying source generator. If that generator is not available any more, null is returned.


reset

public void reset()
           throws IllegalGeneratorStateException
Throws:
IllegalGeneratorStateException

close

public void close()

isParallelizable

public boolean isParallelizable()

isThreadSafe

public boolean isThreadSafe()

toString

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


Copyright © 2011. All Rights Reserved.