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 TypeMethodDescriptionvoidclear()Clears all registered injectors.booleancustomInjectorSupported(@NotNull InjectionPoint injectionPoint) Checks if any registered custom injector supports the given injection point.@NotNull List<CustomInjector>Returns an unmodifiable ordered view of all registered injectors.booleanisEmpty()Checks if the registry is empty.voidregister(@NotNull CustomInjector injector) Registers a custom injector.intsize()Returns the number of registered injectors.booleanunregister(@NotNull CustomInjector injector) Unregisters a custom injector.
-
Method Details
-
register
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
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
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
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
-