org.unitils.objectvalidation.objectcreator.generator
Class WildCardTypeGenerator
java.lang.Object
org.unitils.objectvalidation.objectcreator.generator.WildCardTypeGenerator
- All Implemented Interfaces:
- Generator
public class WildCardTypeGenerator
- extends Object
- implements Generator
Generates objects of type WildcardTypeImpl.
- Since:
- 1.1.8
- Author:
- Willemijn Wouters
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
WildCardTypeGenerator
protected WildCardTypeGenerator(ObjectCreator objectCreator)
- Parameters:
objectCreator -
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 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.- See Also:
Generator.generateObject(java.lang.Class, java.util.List, java.util.List, java.util.List)
generateObjectFromWildCard
public Object generateObjectFromWildCard(sun.reflect.generics.reflectiveObjects.WildcardTypeImpl wildCard)
getClassesOfSubtypes
protected Set<?> getClassesOfSubtypes(sun.reflect.generics.reflectiveObjects.WildcardTypeImpl wildcard,
Set<?> allClasses)
- Get the subtypes of a class (based on a wildcard).
- Parameters:
wildcard: - the wildcard of the genericallClasses: - A collection where the Generator should add the found classes.
- Returns:
Set
getClassesOfSuperType
protected Set<Class<?>> getClassesOfSuperType(sun.reflect.generics.reflectiveObjects.WildcardTypeImpl wildcard,
Set<Class<?>> allClasses)
- An
WildcardTypeImpl can have multiple lowerbounds (super).
- Parameters:
wildcard: - the wildcard of the genericallClasses: - A collection where the Generator should add the found classes.
- Returns:
Set
Copyright © 2013-2015. All Rights Reserved.