org.unitils.objectvalidation.objectcreator.generator
Interface Generator

All Known Implementing Classes:
BuilderGenerator, CollectionGenerator, CompositeGenerator, DefaultGenerator, EnumGenerator, LastResortGenerator, MocksGenerator, ParameterizedTypeGenerator, PrimitiveGenerator, TypeVariableImplGenerator, WildCardTypeGenerator

public interface Generator

A generator represents an object factory for the purpose of testing it against rules. If the default provided generators returns null object you can define your own.

Since:
Feb 20, 2012
Author:
Jeroen Horemans

Method Summary
 Object generateObject(Class<?> clazz, List<Object> input, List<Class<?>> inputClasses, List<TreeNode> genericSubTypes)
           
 

Method Detail

generateObject

Object generateObject(Class<?> clazz,
                      List<Object> input,
                      List<Class<?>> inputClasses,
                      List<TreeNode> genericSubTypes)
                      throws Exception
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.


Copyright © 2013-2015. All Rights Reserved.