org.databene.benerator.composite
Class SourceAwareGenerator<E>
java.lang.Object
org.databene.benerator.util.AbstractGenerator<P>
org.databene.benerator.wrapper.GeneratorWrapper<E,E>
org.databene.benerator.wrapper.GeneratorProxy<E>
org.databene.benerator.composite.SourceAwareGenerator<E>
- All Implemented Interfaces:
- java.io.Closeable, Generator<E>, org.databene.commons.MessageHolder, org.databene.commons.Resettable, org.databene.commons.ThreadAware
public class SourceAwareGenerator<E>
- extends GeneratorProxy<E>
- implements org.databene.commons.MessageHolder
Generator
proxy that combines a 'source' entity generator
with variable support and ComponentBuilders.
Created: 29.08.2010 09:59:03
- Since:
- 0.6.4
- Author:
- Volker Bergmann
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
SourceAwareGenerator
public SourceAwareGenerator(java.lang.String instanceName,
Generator<E> source,
java.util.List<GeneratorComponent<E>> components,
BeneratorContext context)
- Parameters:
source
- another Generator of entities that serves as Entity builder.
It may construct empty Entities or may import them (so this may overwrite imported attributes).instanceName
- instance name for the generated entities.
init
public void init(GeneratorContext context)
- Specified by:
init
in interface Generator<E>
- Overrides:
init
in class GeneratorWrapper<E,E>
generate
public ProductWrapper<E> generate(ProductWrapper<E> 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<E>
- Overrides:
generate
in class GeneratorProxy<E>
reset
public void reset()
- Specified by:
reset
in interface org.databene.commons.Resettable
- Overrides:
reset
in class GeneratorWrapper<E,E>
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>
- Overrides:
close
in class GeneratorWrapper<E,E>
getMessage
public java.lang.String getMessage()
- Specified by:
getMessage
in interface org.databene.commons.MessageHolder
toString
public java.lang.String toString()
- Overrides:
toString
in class GeneratorProxy<E>
isParallelizable
public boolean isParallelizable()
- Specified by:
isParallelizable
in interface org.databene.commons.ThreadAware
- Overrides:
isParallelizable
in class GeneratorWrapper<E,E>
isThreadSafe
public boolean isThreadSafe()
- Specified by:
isThreadSafe
in interface org.databene.commons.ThreadAware
- Overrides:
isThreadSafe
in class GeneratorWrapper<E,E>
Copyright © 2013. All Rights Reserved.