Interface CustomInjectorRegistry

All Known Implementing Classes:
DefaultCustomInjectorRegistry

public interface CustomInjectorRegistry
Registry that holds and manages custom injectors.

This registry maintains an ordered list of custom injectors. Injectors are sorted by their CustomInjector.getOrder() value, with lower values having higher priority. When multiple injectors have the same order, they are processed in registration order.

The registry is thread-safe and can be modified during the application lifecycle.

  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Clears all registered injectors.
    boolean
    customInjectorSupported(@NotNull InjectionPoint injectionPoint)
    Checks if any registered custom injector supports the given injection point.
    Returns an unmodifiable ordered view of all registered injectors.
    boolean
    Checks if the registry is empty.
    void
    register(@NotNull CustomInjector injector)
    Registers a custom injector.
    int
    Returns the number of registered injectors.
    boolean
    unregister(@NotNull CustomInjector injector)
    Unregisters a custom injector.
  • Method Details

    • register

      void register(@NotNull @NotNull CustomInjector injector)
      Registers a custom injector.

      The injector will be added to the registry and the sorted view will be updated. Injectors are ordered by their CustomInjector.getOrder() value.

      Parameters:
      injector - the custom injector to register, not null
      Throws:
      NullPointerException - if injector is null
    • unregister

      boolean unregister(@NotNull @NotNull CustomInjector injector)
      Unregisters a custom injector.
      Parameters:
      injector - the custom injector to remove, not null
      Returns:
      true if the injector was found and removed, false otherwise
    • getInjectors

      @NotNull @NotNull List<CustomInjector> getInjectors()
      Returns an unmodifiable ordered view of all registered injectors.

      The list is sorted by CustomInjector.getOrder(), with lower values first.

      Returns:
      an unmodifiable list of injectors in order of priority
    • customInjectorSupported

      boolean customInjectorSupported(@NotNull @NotNull InjectionPoint injectionPoint)
      Checks if any registered custom injector supports the given injection point.
      Parameters:
      injectionPoint - the injection point to check
      Returns:
      true if any custom injector supports this injection point
    • clear

      void clear()
      Clears all registered injectors.
    • size

      int size()
      Returns the number of registered injectors.
      Returns:
      the count of registered injectors
    • isEmpty

      boolean isEmpty()
      Checks if the registry is empty.
      Returns:
      true if no injectors are registered