Class CompositeGenerator<E>
- java.lang.Object
-
- com.rapiddweller.benerator.util.AbstractGenerator<E>
-
- com.rapiddweller.benerator.wrapper.CompositeGenerator<E>
-
- Type Parameters:
E
- the type parameter
- All Implemented Interfaces:
Generator<E>
,com.rapiddweller.common.Resettable
,com.rapiddweller.common.ThreadAware
,java.io.Closeable
,java.lang.AutoCloseable
- Direct Known Subclasses:
AddressGenerator
,BankAccountGenerator
,BankGenerator
,DateTimeGenerator
,PersonGenerator
,RandomDomainGenerator
,SSNGenerator
public abstract class CompositeGenerator<E> extends AbstractGenerator<E>
Generator
implementation that makes use of otherContextAware
objects by which its threading support is influenced.
Created: 20.03.2010 11:19:11- Since:
- 0.6.0
- Author:
- Volker Bergmann
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.List<com.rapiddweller.common.ThreadAware>
components
The Components.protected java.lang.Class<E>
generatedType
The Generated type.-
Fields inherited from class com.rapiddweller.benerator.util.AbstractGenerator
context, logger, state
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
CompositeGenerator(java.lang.Class<E> generatedType)
Instantiates a new Composite generator.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Class<E>
getGeneratedType()
Declares the type of the objects returned by the generate() method.boolean
isParallelizable()
boolean
isThreadSafe()
protected <T extends Generator<U>,U>
TregisterComponent(T component)
Register component t.protected void
registerComponents(com.rapiddweller.common.ThreadAware[] components)
Register components.-
Methods inherited from class com.rapiddweller.benerator.util.AbstractGenerator
assertInitialized, assertNotInitialized, close, getResultWrapper, init, reset, toString, wasInitialized
-
-
-
-
Field Detail
-
generatedType
protected final java.lang.Class<E> generatedType
The Generated type.
-
components
protected final java.util.List<com.rapiddweller.common.ThreadAware> components
The Components.
-
-
Constructor Detail
-
CompositeGenerator
protected CompositeGenerator(java.lang.Class<E> generatedType)
Instantiates a new Composite generator.- Parameters:
generatedType
- the generated type
-
-
Method Detail
-
registerComponent
protected <T extends Generator<U>,U> T registerComponent(T component)
Register component t.- Type Parameters:
T
- the type parameterU
- the type parameter- Parameters:
component
- the component- Returns:
- the t
-
registerComponent
protected <T extends com.rapiddweller.common.Converter<U,V>,U,V> T registerComponent(T component)
Register component t.- Type Parameters:
T
- the type parameterU
- the type parameterV
- the type parameter- Parameters:
component
- the component- Returns:
- the t
-
registerComponents
protected void registerComponents(com.rapiddweller.common.ThreadAware[] components)
Register components.- Parameters:
components
- the components
-
getGeneratedType
public java.lang.Class<E> getGeneratedType()
Description copied from interface:Generator
Declares the type of the objects returned by the generate() method.- Returns:
- the generated type
-
isThreadSafe
public boolean isThreadSafe()
-
isParallelizable
public boolean isParallelizable()
-
-