类 Instantiator<T>
java.lang.Object
cn.taketoday.util.Instantiator<T>
- 类型参数:
T- the type to instantiate
Simple factory used to instantiate objects by injecting available parameters.
- 从以下版本开始:
- 4.0 2022/2/18 10:53
- 作者:
- Phillip Webb, Harry Yang
-
嵌套类概要
嵌套类修饰符和类型类说明static interfaceCallback used to register available parameters.static interfaceStrategy for handling a failure that occurs when instantiating a type. -
构造器概要
构造器构造器说明Instantiator(Class<?> type, Consumer<Instantiator.AvailableParameters> availableParameters) Create a newInstantiatorinstance for the given type.Instantiator(Class<?> type, Consumer<Instantiator.AvailableParameters> availableParameters, Instantiator.FailureHandler failureHandler) Create a newInstantiatorinstance for the given type. -
方法概要
修饰符和类型方法说明instantiate(ClassLoader classLoader, Collection<String> names) Instantiate the given set of class name, injecting constructor arguments as necessary.instantiate(Collection<String> names) Instantiate the given set of class name, injecting constructor arguments as necessary.instantiateTypes(Collection<Class<?>> types) Instantiate the given set of classes, injecting constructor arguments as necessary.
-
构造器详细资料
-
Instantiator
Create a newInstantiatorinstance for the given type.- 参数:
type- the type to instantiateavailableParameters- consumer used to register available parameters
-
Instantiator
public Instantiator(Class<?> type, Consumer<Instantiator.AvailableParameters> availableParameters, Instantiator.FailureHandler failureHandler) Create a newInstantiatorinstance for the given type.- 参数:
type- the type to instantiateavailableParameters- consumer used to register available parametersfailureHandler- aInstantiator.FailureHandlerthat will be called in case of failure when instantiating objects
-
-
方法详细资料
-
instantiate
Instantiate the given set of class name, injecting constructor arguments as necessary.- 参数:
names- the class names to instantiate- 返回:
- a list of instantiated instances
-
instantiate
Instantiate the given set of class name, injecting constructor arguments as necessary.- 参数:
classLoader- the source classloadernames- the class names to instantiate- 返回:
- a list of instantiated instances
-
instantiateTypes
Instantiate the given set of classes, injecting constructor arguments as necessary.- 参数:
types- the types to instantiate- 返回:
- a list of instantiated instances
-