org.databene.benerator.wrapper
Class ValidatingGeneratorProxy<E>

java.lang.Object
  extended by org.databene.benerator.util.AbstractGenerator<P>
      extended by org.databene.benerator.util.ValidatingGenerator<E>
          extended by org.databene.benerator.wrapper.ValidatingGeneratorProxy<E>
All Implemented Interfaces:
java.io.Closeable, Generator<E>, org.databene.commons.Resettable, org.databene.commons.ThreadAware

public class ValidatingGeneratorProxy<E>
extends ValidatingGenerator<E>

Generator proxy that uses another generator for creating values and filters out invalid ones.
Created: 29.08.2006 08:27:11

See Also:
ValidatingGenerator

Field Summary
 
Fields inherited from class org.databene.benerator.util.ValidatingGenerator
ERROR_THRESHOLD, validator, WARNING_THRESHOLD
 
Fields inherited from class org.databene.benerator.util.AbstractGenerator
context, state
 
Constructor Summary
ValidatingGeneratorProxy(Generator<E> source, org.databene.commons.Validator<E> validator)
          Constructor with the source generator and the validator to use
 
Method Summary
 void close()
          Calls the close() method on the source generator
protected  ProductWrapper<E> doGenerate(ProductWrapper<E> wrapper)
          Callback method implementation from ValidatingGenerator.
 java.lang.Class<E> getGeneratedType()
          Declares the type of the objects returned by the generate() method.
 void init(GeneratorContext context)
           
 boolean isParallelizable()
           
 boolean isThreadSafe()
           
 void reset()
          Calls the reset() method on the source generator
 java.lang.String toString()
           
 
Methods inherited from class org.databene.benerator.util.ValidatingGenerator
generate
 
Methods inherited from class org.databene.benerator.util.AbstractGenerator
assertInitialized, assertNotInitialized, getResultWrapper, wasInitialized
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ValidatingGeneratorProxy

public ValidatingGeneratorProxy(Generator<E> source,
                                org.databene.commons.Validator<E> validator)
Constructor with the source generator and the validator to use

Method Detail

getGeneratedType

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


doGenerate

protected ProductWrapper<E> doGenerate(ProductWrapper<E> wrapper)
Callback method implementation from ValidatingGenerator. This calls the source's generate() method and returns its result.

Specified by:
doGenerate in class ValidatingGenerator<E>

init

public void init(GeneratorContext context)
Specified by:
init in interface Generator<E>
Overrides:
init in class AbstractGenerator<E>

reset

public void reset()
Calls the reset() method on the source generator

Specified by:
reset in interface org.databene.commons.Resettable
Overrides:
reset in class AbstractGenerator<E>

close

public void close()
Calls the close() method on the source generator

Specified by:
close in interface java.io.Closeable
Specified by:
close in interface Generator<E>
Overrides:
close in class AbstractGenerator<E>

isThreadSafe

public boolean isThreadSafe()

isParallelizable

public boolean isParallelizable()

toString

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


Copyright © 2013. All Rights Reserved.