接口 DependencyInjector
- 所有已知实现类:
GuiceDependencyInjector
public interface DependencyInjector
This interface defines the contract for a dependency injector.
It provides methods to retrieve instances and variables of a specific type.
- 作者:
- codeboyzhou
-
方法概要
修饰符和类型方法说明<T> TgetInstance(Class<T> type) Returns an instance of the specified type.<T> TgetVariable(Class<T> type, String name) Returns the value of the specified variable.booleanReturns whether the dependency injector is initialized.
-
方法详细资料
-
getInstance
Returns an instance of the specified type.- 类型参数:
T- the type of the instance to return- 参数:
type- the class of the instance to return- 返回:
- an instance of the specified type
-
getVariable
Returns the value of the specified variable.- 类型参数:
T- the type of the variable to return- 参数:
type- the class of the variable to returnname- the name of the variable to return- 返回:
- the value of the specified variable
-
isInitialized
boolean isInitialized()Returns whether the dependency injector is initialized.- 返回:
trueif the dependency injector is initialized,falseotherwise
-