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

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

public class NullInjectingGeneratorProxy<E>
extends NullableGeneratorWrapper<E,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.NullableGeneratorWrapper
realGenerator
 
Fields inherited from class org.databene.benerator.nullable.AbstractNullableGenerator
state
 
Constructor Summary
NullInjectingGeneratorProxy(NullableGenerator<E> source, double nullQuota)
           
 
Method Summary
 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)
           
 java.lang.String toString()
           
 
Methods inherited from class org.databene.benerator.nullable.NullableGeneratorWrapper
close, isParallelizable, isThreadSafe, reset
 
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

NullInjectingGeneratorProxy

public NullInjectingGeneratorProxy(NullableGenerator<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 NullableGeneratorWrapper<E,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.


toString

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


Copyright © 2011. All Rights Reserved.