T
- the type to instantiatepublic class Instantiator<T> extends Object
Modifier and Type | Class and Description |
---|---|
static interface |
Instantiator.AvailableParameters
Callback used to register available parameters.
|
Constructor and Description |
---|
Instantiator(Class<?> type,
Consumer<Instantiator.AvailableParameters> availableParameters)
Create a new
Instantiator instance for the given type. |
Modifier and Type | Method and Description |
---|---|
List<T> |
instantiate(ClassLoader classLoader,
Collection<String> names)
Instantiate the given set of class name, injecting constructor arguments as
necessary.
|
List<T> |
instantiate(Collection<String> names)
Instantiate the given set of class name, injecting constructor arguments as
necessary.
|
List<T> |
instantiateTypes(Collection<Class<?>> types)
Instantiate the given set of classes, injecting constructor arguments as necessary.
|
public Instantiator(Class<?> type, Consumer<Instantiator.AvailableParameters> availableParameters)
Instantiator
instance for the given type.type
- the type to instantiateavailableParameters
- consumer used to register available parameterspublic List<T> instantiate(Collection<String> names)
names
- the class names to instantiatepublic List<T> instantiate(ClassLoader classLoader, Collection<String> names)
classLoader
- the source classloadernames
- the class names to instantiatepublic List<T> instantiateTypes(Collection<Class<?>> types)
types
- the types to instantiate