|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.databene.benerator.util.AbstractGenerator<P>
org.databene.benerator.wrapper.MultiGeneratorWrapper<E,E>
org.databene.benerator.wrapper.AlternativeGenerator<E>
public class AlternativeGenerator<E>
On each call to generate(), it chooses a generator from a collection,
calls its generate() method and returns the product.
Created: 30.08.2006 21:56:59
Field Summary |
---|
Fields inherited from class org.databene.benerator.wrapper.MultiGeneratorWrapper |
---|
generatedType, sources |
Fields inherited from class org.databene.benerator.util.AbstractGenerator |
---|
context, logger, state |
Constructor Summary | |
---|---|
AlternativeGenerator(java.lang.Class<E> targetType,
Generator<E>... sources)
Initializes the generator to a collection of source generators |
Method Summary | |
---|---|
ProductWrapper<E> |
generate(ProductWrapper<E> wrapper)
Returns an instance of the generic type E, using the ProductWrapper
instance provided as argument. |
Methods inherited from class org.databene.benerator.wrapper.MultiGeneratorWrapper |
---|
addSource, availableSourceCount, close, generateFromAllSources, generateFromAvailableSource, generateFromRandomSource, generateFromSource, getAvailableSource, getGeneratedType, getSource, getSources, getSourceWrapper, init, isParallelizable, isThreadSafe, reset, setSources, toString |
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 |
---|
public AlternativeGenerator(java.lang.Class<E> targetType, Generator<E>... sources)
Method Detail |
---|
public ProductWrapper<E> generate(ProductWrapper<E> wrapper)
Generator
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.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |