T - The type of object to instantiatepublic abstract class TypeInstantiator<T> extends Object
TypeInstantiator implementations are responsible for instantiating
instances of type T.| Modifier | Constructor and Description |
|---|---|
protected |
TypeInstantiator(Class<T> type)
Constructor for a custom
TypeInstantiator implementation |
protected |
TypeInstantiator(Class<T> type,
boolean custom)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
isCustom()
Indicates if this is a custom instantiator for this type, or a generic one
provided by the dependency injection framework
|
abstract T |
load(InstanceLocator locator)
Instantiate the instance of T
|
protected TypeDependencyNotAvailableException |
notAvailable(Throwable cause) |
Class<T> |
type()
The type that will be instantiated
|
protected TypeInstantiator(Class<T> type)
TypeInstantiator implementationtype - The type that will be instantiatedprotected TypeInstantiator(Class<T> type, boolean custom)
type - The type that will be instantiatedcustom - if true indicates this is a custom TypeInstantiator
implementation, as opposed to one generated by the dependency
injection runtimepublic boolean isCustom()
public abstract T load(InstanceLocator locator) throws TypeDependencyNotAvailableException
locator - The InstanceLocator that provides the dependencies
required to instantiate TTypeDependencyNotAvailableException - if the type could not be instantiatedpublic final Class<T> type()
TypeInstantiator instantiatesprotected final TypeDependencyNotAvailableException notAvailable(Throwable cause)