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
generateObject
Object generateObject(Class<?> clazz,
List<Object> input,
List<Class<?>> inputClasses,
List<TreeNode> genericSubTypes)
throws Exception
- Parameters:
clazz - The class of the object to generateinput - the parameters to give to the constructorinputClasses - the types of the constructor parametersgenericSubTypes - 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.