类 GuiceDependencyInjector
java.lang.Object
com.github.codeboyzhou.mcp.declarative.di.GuiceDependencyInjector
- 所有已实现的接口:
DependencyInjector
This class implements the
DependencyInjector interface using Google Guice.- 作者:
- codeboyzhou
-
构造器概要
构造器构造器说明GuiceDependencyInjector(com.google.inject.Injector injector) Creates a new instance ofGuiceDependencyInjectorwith the specified GuiceInjector. -
方法概要
修饰符和类型方法说明<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.
-
构造器详细资料
-
GuiceDependencyInjector
public GuiceDependencyInjector(com.google.inject.Injector injector) Creates a new instance ofGuiceDependencyInjectorwith the specified GuiceInjector.- 参数:
injector- the GuiceInjectorto use for dependency injection
-
-
方法详细资料
-
getInstance
从接口复制的说明:DependencyInjectorReturns an instance of the specified type.- 指定者:
getInstance在接口中DependencyInjector- 类型参数:
T- the type of the instance to return- 参数:
type- the class of the instance to return- 返回:
- an instance of the specified type
-
getVariable
从接口复制的说明:DependencyInjectorReturns the value of the specified variable.- 指定者:
getVariable在接口中DependencyInjector- 类型参数:
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
public boolean isInitialized()从接口复制的说明:DependencyInjectorReturns whether the dependency injector is initialized.- 指定者:
isInitialized在接口中DependencyInjector- 返回:
trueif the dependency injector is initialized,falseotherwise
-