Class Injectors

java.lang.Object
io.github.pustike.inject.Injectors

public final class Injectors
extends Object
This class provides factory methods to create Injector with bindings specified by modules and using an InjectionPointLoader.
  • Method Details

    • create

      public static Injector create​(Module... modules)
      Creates a new Injector with bindings specified by given modules.
      Parameters:
      modules - an array of modules specifying type bindings
      Returns:
      the newly created injector
      See Also:
      create(Iterable)
    • create

      public static Injector create​(Iterable<Module> modules)
      Creates a new Injector with bindings specified by given modules.
      Parameters:
      modules - an iterable (list) of modules specifying type bindings
      Returns:
      the newly created injector
      See Also:
      create(InjectionPointLoader, Iterable)
    • create

      public static Injector create​(InjectionPointLoader injectionPointLoader, Iterable<Module> modules)
      Creates a new Injector with bindings specified by given modules and using an injection point loader.
      Parameters:
      injectionPointLoader - the injection point loader,
      modules - an iterable (list) of modules specifying type bindings
      Returns:
      the newly created injector
      See Also:
      create(Module...)
    • dispose

      public static void dispose​(Injector injector)
      Dispose or release all data held by the Default Injector.
      Parameters:
      injector - the default injector
      Throws:
      IllegalArgumentException - if injector is not an instance of Default Injector