org.databene.benerator.util
Class AbstractGenerator<E>

java.lang.Object
  extended by org.databene.benerator.util.AbstractGenerator<E>
All Implemented Interfaces:
java.io.Closeable, Generator<E>, org.databene.commons.Resettable, org.databene.commons.ThreadAware
Direct Known Subclasses:
AbstractNonNullGenerator, CompositeGenerator, DataSourceGenerator, GeneratorWrapper, IteratingGenerator, MultiGeneratorWrapper, ThreadSafeGenerator, UnsafeGenerator, ValidatingGenerator

public abstract class AbstractGenerator<E>
extends java.lang.Object
implements Generator<E>

Abstract Generator implementation which holds a state and state management methods.

Created: 24.02.2010 12:28:05

Since:
0.6.0
Author:
Volker Bergmann

Field Summary
protected  GeneratorContext context
           
protected  org.slf4j.Logger logger
           
protected  GeneratorState state
           
 
Constructor Summary
AbstractGenerator()
           
 
Method Summary
protected  void assertInitialized()
           
protected  void assertNotInitialized()
           
 void close()
          Closes the generator.
protected  ProductWrapper<E> getResultWrapper()
           
 void init(GeneratorContext context)
           
 void reset()
           
 java.lang.String toString()
           
 boolean wasInitialized()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.databene.benerator.Generator
generate, getGeneratedType
 
Methods inherited from interface org.databene.commons.ThreadAware
isParallelizable, isThreadSafe
 

Field Detail

logger

protected org.slf4j.Logger logger

state

protected GeneratorState state

context

protected GeneratorContext context
Constructor Detail

AbstractGenerator

public AbstractGenerator()
Method Detail

init

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

wasInitialized

public boolean wasInitialized()
Specified by:
wasInitialized in interface Generator<E>

reset

public void reset()
Specified by:
reset in interface org.databene.commons.Resettable

close

public void close()
Description copied from interface: Generator
Closes the generator. After invocation the state is unavailable.

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

assertNotInitialized

protected final void assertNotInitialized()

assertInitialized

protected final void assertInitialized()

getResultWrapper

protected ProductWrapper<E> getResultWrapper()

toString

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


Copyright © 2013. All Rights Reserved.