类 GuiceDependencyInjector

java.lang.Object
com.github.codeboyzhou.mcp.declarative.di.GuiceDependencyInjector
所有已实现的接口:
DependencyInjector

public final class GuiceDependencyInjector extends Object implements DependencyInjector
This class implements the DependencyInjector interface using Google Guice.
作者:
codeboyzhou
  • 构造器详细资料

    • GuiceDependencyInjector

      public GuiceDependencyInjector(com.google.inject.Injector injector)
      Creates a new instance of GuiceDependencyInjector with the specified Guice Injector.
      参数:
      injector - the Guice Injector to use for dependency injection
  • 方法详细资料

    • getInstance

      public <T> T getInstance(Class<T> type)
      从接口复制的说明: DependencyInjector
      Returns 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

      public <T> T getVariable(Class<T> type, String name)
      从接口复制的说明: DependencyInjector
      Returns the value of the specified variable.
      指定者:
      getVariable 在接口中 DependencyInjector
      类型参数:
      T - the type of the variable to return
      参数:
      type - the class of the variable to return
      name - the name of the variable to return
      返回:
      the value of the specified variable
    • isInitialized

      public boolean isInitialized()
      从接口复制的说明: DependencyInjector
      Returns whether the dependency injector is initialized.
      指定者:
      isInitialized 在接口中 DependencyInjector
      返回:
      true if the dependency injector is initialized, false otherwise