public static class UtlObjectGraph.BasePopulationHelper extends Object implements UtlObjectGraph.PopulationHelper
Subclasses may extend this class to override individual methods.
| Constructor and Description |
|---|
BasePopulationHelper() |
| Modifier and Type | Method and Description |
|---|---|
Collection<?> |
getFactoryObjects()
Returns a collection of factory objects to help in creating new Objects.
|
Object |
getNewInstance(Class<?> type,
Stack<String> getterStack,
Random random)
Allows the helper to provide a new object instance that is perhaps more customized than that provided
by the random populator.
|
Class<?>[] |
getTypeParameters(Object o,
Class<?> parameterizedType,
Stack<String> getterStack)
Used to retrieve the concrete types for initializing a class with
|
boolean |
shouldPopulate(Class<?> type,
Stack<String> getterStack,
Random random)
Called by the populator to test whether a field at the given stack should be populated.
|
public Collection<?> getFactoryObjects()
UtlObjectGraph.PopulationHelpergetFactoryObjects in interface UtlObjectGraph.PopulationHelperpublic Class<?>[] getTypeParameters(Object o, Class<?> parameterizedType, Stack<String> getterStack)
UtlObjectGraph.PopulationHelpergetTypeParameters in interface UtlObjectGraph.PopulationHelpero - The generic object being populated.parameterizedType - the parameterized type whose types need to be resolvedgetterStack - The location in the stack from the root object being intialized.public boolean shouldPopulate(Class<?> type, Stack<String> getterStack, Random random)
UtlObjectGraph.PopulationHelpershouldPopulate in interface UtlObjectGraph.PopulationHelpertype - The type of the field.getterStack - The field's path.random - An instanct of random to allow for predictable randomization.public Object getNewInstance(Class<?> type, Stack<String> getterStack, Random random)
UtlObjectGraph.PopulationHelpergetNewInstance in interface UtlObjectGraph.PopulationHelpertype - The object type to create.getterStack - The stack representing the accessor method from the root object to the getter.random - A random seeded for use in population.Copyright © 2019 Neeve Research, LLC. All Rights Reserved.