Interface Injector

All Known Implementing Classes:
AbstractInjector, DefaultInjector

public interface Injector
Builds the graphs of objects. The injector tracks the dependencies for each type and uses bindings to inject them.
  • Method Summary

    Modifier and Type
    Method
    Description
    <T> Class<? extends T>
    Returns the implementation class for the given type
    <T> Class<? extends T>
    Returns the implementation class for the given name
    <T> T
    getInstance(Class<T> type)
    Returns the appropriate instance for the given type
    <T> T
    getInstance(String className)
    Returns the appropriate instance for the given name
    void
    Injects dependencies into the fields and methods of instance.
  • Method Details

    • injectMembers

      void injectMembers(Object instance)
      Injects dependencies into the fields and methods of instance. An injectable constructor is ignored.
      Parameters:
      instance -
    • getInstance

      <T> T getInstance(Class<T> type)
      Returns the appropriate instance for the given type
      Parameters:
      type -
      Returns:
    • getInstance

      <T> T getInstance(String className)
      Returns the appropriate instance for the given name
      Parameters:
      className -
      Returns:
    • getImplementationClass

      <T> Class<? extends T> getImplementationClass(Class<T> typ)
      Returns the implementation class for the given type
      Parameters:
      typ -
      Returns:
    • getImplementationClass

      <T> Class<? extends T> getImplementationClass(String className)
      Returns the implementation class for the given name
      Parameters:
      className -
      Returns: