public static class UtlObjectGraph.BasePopulationHelper extends Object implements UtlObjectGraph.PopulationHelper
Subclasses may extend this class to override individual methods.
Constructor and Description |
---|
UtlObjectGraph.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.PopulationHelper
getFactoryObjects
in interface UtlObjectGraph.PopulationHelper
public Class<?>[] getTypeParameters(Object o, Class<?> parameterizedType, Stack<String> getterStack)
UtlObjectGraph.PopulationHelper
getTypeParameters
in interface UtlObjectGraph.PopulationHelper
o
- 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.PopulationHelper
shouldPopulate
in interface UtlObjectGraph.PopulationHelper
type
- 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.PopulationHelper
getNewInstance
in interface UtlObjectGraph.PopulationHelper
type
- 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.