Class InjectionRegistry


  • public class InjectionRegistry
    extends java.lang.Object
    Registry of injections.
    Author:
    Daniel Sagenschneider
    • Method Detail

      • getDependency

        public <T> T getDependency​(java.lang.String qualifier,
                                   java.lang.Class<? extends T> type,
                                   SupplierSourceContext supplierContext)
        Obtains the dependency.
        Parameters:
        qualifier - Qualifier. May be null.
        type - Type.
        supplierContext - SupplierSourceContext.
        Returns:
        Dependency.
      • registerForInjection

        public void registerForInjection​(java.lang.Class<?> clazz,
                                         SupplierSourceContext supplierContext)
                                  throws java.lang.Exception
        Registers the Class for injection.
        Parameters:
        clazz - Class to have dependencies injected.
        supplierContext - SupplierSourceContext for the dependencies.
        Throws:
        java.lang.Exception - If fails to register for injection.
      • forEachDependency

        public void forEachDependency​(java.util.function.BiConsumer<java.lang.String,​java.lang.Class<?>> visitor)
        Iterate over all dependencies.
        Parameters:
        visitor - Visitor for all dependencies.