com.bm.datagen.relation
Class SingleBeanGenerator<T>

java.lang.Object
  extended by com.bm.datagen.relation.SingleBeanGenerator<T>
Type Parameters:
T - - the type of the entity bean to creat
All Implemented Interfaces:
Generator<T>, EntityRelation<T>

public class SingleBeanGenerator<T>
extends java.lang.Object
implements Generator<T>, EntityRelation<T>

Generates 1 entity bean (using own configurator settings) to enable ben creation for beans wich are using 1:1 or N:1 relations.

Author:
Daniel Wiese

Constructor Summary
SingleBeanGenerator(java.lang.Class<T> beanToCreate)
          Default constructor.
SingleBeanGenerator(java.lang.Class<T> beanToCreate, Generator<?>[] additionalGenerators)
          Contructor using additional generator (for this generator).
 
Method Summary
 java.lang.Class<T> getUsedBeans()
          Returns the releated bean: The Type of the bean wich is generated by this generator.
 T getValue()
          Returns the next entity bean of type T.
 void preCreate()
          Gets called before every jUnitTest.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SingleBeanGenerator

public SingleBeanGenerator(java.lang.Class<T> beanToCreate,
                           Generator<?>[] additionalGenerators)
Contructor using additional generator (for this generator).

Parameters:
beanToCreate - - the bean to create
additionalGenerators - - if the beand creation sould have some special rules (creators)

SingleBeanGenerator

public SingleBeanGenerator(java.lang.Class<T> beanToCreate)
Default constructor.

Parameters:
beanToCreate - - the bean to create
Method Detail

preCreate

public void preCreate()
Gets called before every jUnitTest.


getValue

public T getValue()
Returns the next entity bean of type T.

Specified by:
getValue in interface Generator<T>
Returns:
next entity bean of type T.
See Also:
Generator.getValue()

getUsedBeans

public java.lang.Class<T> getUsedBeans()
Returns the releated bean: The Type of the bean wich is generated by this generator.

Specified by:
getUsedBeans in interface EntityRelation<T>
Returns:
the releated bean: The Type of the bean wich is generated by this generator.
See Also:
EntityRelation.getUsedBeans()


Copyright © 2008. All Rights Reserved.