|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.unitils.objectvalidation.objectcreator.generator.helper.GeneratorHelper
public class GeneratorHelper
This class generates supertypes or subtypes from a specific class.
| Method Summary | |
|---|---|
static Set<Class<?>> |
compareSubtypesSets(Set<?> set1,
Set<?> set2)
Returns only the in common classes of set1 and set2 |
static List<TreeNode> |
createNodes(Type type)
|
protected Object |
createRandomObjects(Set<Class<?>> classes)
This method creates a random object of a random class found with WildCardTypeGenerator.getClassesOfSubtypes(sun.reflect.generics.reflectiveObjects.WildcardTypeImpl, java.util.Set) or WildCardTypeGenerator.getClassesOfSuperType(sun.reflect.generics.reflectiveObjects.WildcardTypeImpl, java.util.Set). |
static TreeNode |
createTreenode(Field field)
|
static TreeNode |
createTreenode(Type type)
|
static List<TreeNode> |
createTreenodes(Field field)
|
static Object |
generateSubTypesObject(Class<?> classForType)
Generate the exact object or a subtype from a specific class. |
protected Object |
generateSubTypesObjectInstance(Class<?> classForType)
|
static Set<?> |
getClassesOfSubtypes(Class<?> clzz,
Set<?> allClasses)
Get the subtypes of a Class |
protected Set<?> |
getClassesOfSubtypesInstance(Class<?> clzz,
Set<?> allClasses)
|
static Set<Class<?>> |
getClassesOfSuperType(Class<?> clzz,
Set<Class<?>> allClasses)
Get all the supertypes from a Class |
protected Set<Class<?>> |
getClassesOfSuperTypeInstance(Class<?> clzz,
Set<Class<?>> allClasses)
|
static GeneratorHelper |
getInstance()
|
static Set<Class<? extends Object>> |
getSetWithClassesThatOverridesASpecificMethod(Set<Class<? extends Object>> set,
String methodName,
Class<?>... parameterTypes)
Goes through all the objects in a set and removes all the classes that doesn't override a specific method. |
static Object |
pickAndCreateAnObjectFromASet(Set<Class<?>> collClasses)
This method creates a random object from a Set of classes. |
protected Object |
pickAndCreateAnObjectFromASetInstance(Set<Class<?>> collClasses)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static Set<Class<?>> getClassesOfSuperType(Class<?> clzz,
Set<Class<?>> allClasses)
Class
clzz: - look for supertypes of this Class.allClasses: - A collection where the Generator should add the found classes.
Set
public static Set<Class<?>> compareSubtypesSets(Set<?> set1,
Set<?> set2)
set1: - an object of type Setset2: - an object of type Set
Setpublic static Object generateSubTypesObject(Class<?> classForType)
classForType: - the generator should look for a subtype of this class.
Object
public static Set<?> getClassesOfSubtypes(Class<?> clzz,
Set<?> allClasses)
Class
clzz: - look for subtypes of this Class.allClasses: - A collection where the Generator should add the found classes.
Set
public static Set<Class<? extends Object>> getSetWithClassesThatOverridesASpecificMethod(Set<Class<? extends Object>> set,
String methodName,
Class<?>... parameterTypes)
set: - A set of classes.methodName: - the method that this method should findparameterTypes: - the parameters of the method that the classes must override
Setpublic static Object pickAndCreateAnObjectFromASet(Set<Class<?>> collClasses)
Set of classes.
collClasses: - This is a collection of classes.
Objectpublic static GeneratorHelper getInstance()
protected Set<Class<?>> getClassesOfSuperTypeInstance(Class<?> clzz,
Set<Class<?>> allClasses)
protected Object generateSubTypesObjectInstance(Class<?> classForType)
protected Set<?> getClassesOfSubtypesInstance(Class<?> clzz,
Set<?> allClasses)
protected Object pickAndCreateAnObjectFromASetInstance(Set<Class<?>> collClasses)
protected Object createRandomObjects(Set<Class<?>> classes)
WildCardTypeGenerator.getClassesOfSubtypes(sun.reflect.generics.reflectiveObjects.WildcardTypeImpl, java.util.Set) or WildCardTypeGenerator.getClassesOfSuperType(sun.reflect.generics.reflectiveObjects.WildcardTypeImpl, java.util.Set).
classes: - A set with a collection of classes.
Objectpublic static List<TreeNode> createNodes(Type type)
public static TreeNode createTreenode(Type type)
public static TreeNode createTreenode(Field field)
public static List<TreeNode> createTreenodes(Field field)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||