org.databene.benerator.wrapper
Class NonNullGeneratorWrapper<S,P>

java.lang.Object
  extended by org.databene.benerator.util.AbstractGenerator<P>
      extended by org.databene.benerator.wrapper.GeneratorWrapper<S,P>
          extended by org.databene.benerator.wrapper.NonNullGeneratorWrapper<S,P>
All Implemented Interfaces:
java.io.Closeable, Generator<P>, NonNullGenerator<P>, org.databene.commons.Resettable, org.databene.commons.ThreadAware
Direct Known Subclasses:
DateGenerator, EAN13Generator, EAN8Generator, FileContentGenerator, FileNameGenerator, SeedSentenceGenerator, SeedWordGenerator, UniqueFixedLengthStringGenerator

public abstract class NonNullGeneratorWrapper<S,P>
extends GeneratorWrapper<S,P>
implements NonNullGenerator<P>

GeneratorWrapper for NonNullGenerators.

Created: 27.07.2011 11:30:51

Since:
0.7.0
Author:
Volker Bergmann

Field Summary
 
Fields inherited from class org.databene.benerator.util.AbstractGenerator
context, logger, state
 
Constructor Summary
NonNullGeneratorWrapper(NonNullGenerator<S> source)
           
 
Method Summary
 ProductWrapper<P> generate(ProductWrapper<P> wrapper)
          Returns an instance of the generic type E, using the ProductWrapper instance provided as argument.
protected  S generateFromNotNullSource()
           
 NonNullGenerator<S> getSource()
          Returns the source generator
 void setSource(NonNullGenerator<S> source)
          Sets the source generator
 
Methods inherited from class org.databene.benerator.wrapper.GeneratorWrapper
close, equals, generateFromSource, getSourceWrapper, hashCode, init, isParallelizable, isThreadSafe, reset, setSource, toString
 
Methods inherited from class org.databene.benerator.util.AbstractGenerator
assertInitialized, assertNotInitialized, getResultWrapper, wasInitialized
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.databene.benerator.NonNullGenerator
generate
 
Methods inherited from interface org.databene.benerator.Generator
close, getGeneratedType, init, wasInitialized
 
Methods inherited from interface org.databene.commons.ThreadAware
isParallelizable, isThreadSafe
 
Methods inherited from interface org.databene.commons.Resettable
reset
 

Constructor Detail

NonNullGeneratorWrapper

public NonNullGeneratorWrapper(NonNullGenerator<S> source)
Method Detail

getSource

public NonNullGenerator<S> getSource()
Returns the source generator

Overrides:
getSource in class GeneratorWrapper<S,P>

setSource

public void setSource(NonNullGenerator<S> source)
Sets the source generator


generateFromNotNullSource

protected final S generateFromNotNullSource()

generate

public final ProductWrapper<P> generate(ProductWrapper<P> wrapper)
Description copied from interface: Generator
Returns an instance of the generic type E, using the ProductWrapper instance provided as argument. The wrapper may wrap a null value as a regular generator product. If the generator is not available (any more), it returns null instead of the ProductWrapper instance.

Specified by:
generate in interface Generator<P>


Copyright © 2013. All Rights Reserved.