org.databene.benerator.wrapper
Class CompositeStringGenerator

java.lang.Object
  extended by org.databene.benerator.util.AbstractGenerator<P>
      extended by org.databene.benerator.wrapper.GeneratorWrapper<java.lang.Object[],java.lang.String>
          extended by org.databene.benerator.wrapper.CompositeStringGenerator
All Implemented Interfaces:
java.io.Closeable, Generator<java.lang.String>, org.databene.commons.Resettable, org.databene.commons.ThreadAware
Direct Known Subclasses:
TokenCombiner.SimpleTokenCombinator

public abstract class CompositeStringGenerator
extends GeneratorWrapper<java.lang.Object[],java.lang.String>

Takes the output of several source Generators and combines them to a result String. If the source generators generate unique data, the CompositeStringGenerator is able to combine their output to unique values when setting its 'unique' property to 'true'.

Created: 28.07.2010 21:53:41

Since:
0.6.3
Author:
Volker Bergmann

Field Summary
 
Fields inherited from class org.databene.benerator.wrapper.GeneratorWrapper
source
 
Fields inherited from class org.databene.benerator.util.AbstractGenerator
context, state
 
Constructor Summary
CompositeStringGenerator()
           
CompositeStringGenerator(boolean unique)
           
 
Method Summary
 java.lang.String generate()
          Returns an instance of the generic type E.
 java.lang.Class<java.lang.String> getGeneratedType()
          Declares the type of the objects returned by the generate() method.
 void init(GeneratorContext context)
           
protected abstract  Generator<?>[] initSources(GeneratorContext context, boolean unique)
           
 boolean isUnique()
           
 void setUnique(boolean unique)
           
 
Methods inherited from class org.databene.benerator.wrapper.GeneratorWrapper
close, equals, getSource, hashCode, isParallelizable, isThreadSafe, reset, setSource, toString
 
Methods inherited from class org.databene.benerator.util.AbstractGenerator
assertInitialized, assertNotInitialized, wasInitialized
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CompositeStringGenerator

public CompositeStringGenerator()

CompositeStringGenerator

public CompositeStringGenerator(boolean unique)
Method Detail

isUnique

public boolean isUnique()

setUnique

public void setUnique(boolean unique)

getGeneratedType

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


init

public void init(GeneratorContext context)
Specified by:
init in interface Generator<java.lang.String>
Overrides:
init in class GeneratorWrapper<java.lang.Object[],java.lang.String>

generate

public java.lang.String generate()
Description copied from interface: Generator
Returns an instance of the generic type E.


initSources

protected abstract Generator<?>[] initSources(GeneratorContext context,
                                              boolean unique)


Copyright © 2011. All Rights Reserved.