org.unitils.objectvalidation.objectcreator.generator
Class CompositeGenerator

java.lang.Object
  extended by org.unitils.objectvalidation.objectcreator.generator.CompositeGenerator
All Implemented Interfaces:
Generator
Direct Known Subclasses:
DefaultGenerator

public class CompositeGenerator
extends Object
implements Generator

Since:
Feb 20, 2012
Author:
Jeroen Horemans

Constructor Summary
CompositeGenerator()
           
CompositeGenerator(List<Generator> generators)
           
 
Method Summary
 void addGenerators(Generator... generator)
           
 Object generateObject(Class<?> clazz, List<Object> input, List<Class<?>> inputClasses, List<TreeNode> genericSubTypes)
           
 List<Generator> getGenerators()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CompositeGenerator

public CompositeGenerator(List<Generator> generators)

CompositeGenerator

public CompositeGenerator()
Method Detail

generateObject

public Object generateObject(Class<?> clazz,
                             List<Object> input,
                             List<Class<?>> inputClasses,
                             List<TreeNode> genericSubTypes)
                      throws Exception
Specified by:
generateObject in interface Generator
Parameters:
clazz - The class of the object to generate
input - the parameters to give to the constructor
inputClasses - the types of the constructor parameters
genericSubTypes - if clazz has generic parameters here they should be entered
Returns:
Object a randomly generated object or null if it was impossible to generate
Throws:
Exception - if illegal calls to object constructors.

addGenerators

public void addGenerators(Generator... generator)

getGenerators

public List<Generator> getGenerators()
Returns:
the generators


Copyright © 2013-2015. All Rights Reserved.