java.lang.Object
page.codeberg.rrangelo.contextfx.components.Injector
Direct Known Subclasses:
ReactiveInjector

public class Injector extends Object
Orchestrates the dependency injection phase for all registered component types.

After component discovery and registration by Scanner, Injector drives the injection phase by delegating to the type-specific injectors in the following order:

  1. ModelInjector — injects dependencies into @Model components.
  2. ComponentInjector — injects dependencies into @Component components.
  3. ServiceInjector — injects dependencies into @Service components.
  4. ControllerInjector — injects dependencies into @Controller components.
  5. ViewInjector — injects dependencies into @View components.

The ordering ensures that lower-level dependencies (models, services) are fully wired before higher-level components (controllers, views) are processed.

Author:
Ramon Rangel Osorio <ramon.rangel@protonmail.com>
See Also:
  • Constructor Details

    • Injector

      public Injector(Scanner scanner)
      Creates an Injector bound to the given Scanner result set.
      Parameters:
      scanner - the scanner whose discovered class list will be processed during injection
  • Method Details

    • inject

      public final void inject()
      Runs dependency injection across all component types in the correct dependency order. Models are injected first so that controllers and views can safely reference them.