接口 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> T
    getInstance(Class<T> type)
    Returns an instance of the specified type.
    <T> T
    getVariable(Class<T> type, String name)
    Returns the value of the specified variable.
    boolean
    Returns whether the dependency injector is initialized.
  • 方法详细资料

    • getInstance

      <T> T getInstance(Class<T> type)
      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

      <T> T getVariable(Class<T> type, String name)
      Returns the value of the specified variable.
      类型参数:
      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

      boolean isInitialized()
      Returns whether the dependency injector is initialized.
      返回:
      true if the dependency injector is initialized, false otherwise