Class AbstractInjector

java.lang.Object
org.iworkz.genesis.impl.AbstractInjector
All Implemented Interfaces:
Injector
Direct Known Subclasses:
DefaultInjector

public abstract class AbstractInjector extends Object implements Injector
  • Field Details

    • modulesForSetup

      protected final Module[] modulesForSetup
  • Constructor Details

    • AbstractInjector

      protected AbstractInjector(Module... modules)
  • Method Details

    • getConfiguredModules

      public Module[] getConfiguredModules()
    • setup

      protected void setup()
    • postSetup

      protected void postSetup()
      Supports the bootstrapping of the Injector. Here the injector can already be used (e.g. for internal injections) but it is not available for external use.
    • createPreliminaryReflectionHelper

      protected void createPreliminaryReflectionHelper()
    • createFinalReflectionHelper

      protected void createFinalReflectionHelper()
    • configureImplementationFinders

      protected void configureImplementationFinders()
    • injectMembers

      public void injectMembers(Object instance)
      Description copied from interface: Injector
      Injects dependencies into the fields and methods of instance. An injectable constructor is ignored.
      Specified by:
      injectMembers in interface Injector
    • postProcess

      protected void postProcess(InjectionContext ctx)
    • postProcess

      public void postProcess(PostProcessor postProcessor, Map<Object,Set<Object>> createdInstances)
    • isInjected

      protected boolean isInjected(AccessibleObject field)
    • injectMembers

      protected void injectMembers(Object instance, Class<?> classWithMembers, InjectionContext ctx)
    • getInstance

      public <T> T getInstance(Class<T> instanceClass)
      Description copied from interface: Injector
      Returns the appropriate instance for the given type
      Specified by:
      getInstance in interface Injector
      Returns:
    • getImplementationClass

      public <T> Class<? extends T> getImplementationClass(String className)
      Description copied from interface: Injector
      Returns the implementation class for the given name
      Specified by:
      getImplementationClass in interface Injector
      Returns:
    • loadClass

      public <T> Class<? extends T> loadClass(String className)
    • getInstance

      public <T> T getInstance(String className)
      Description copied from interface: Injector
      Returns the appropriate instance for the given name
      Specified by:
      getInstance in interface Injector
      Returns:
    • getQualifierAnnotation

      protected Annotation getQualifierAnnotation(AnnotatedElement annotatedElement)
    • get

      protected <T> T get(Class<T> instanceClass, boolean isProvider, AnnotatedElement annotatedElement, InjectionContext ctx)
    • getImplementationClass

      public <T> Class<? extends T> getImplementationClass(Class<T> injectedClass)
      Description copied from interface: Injector
      Returns the implementation class for the given type
      Specified by:
      getImplementationClass in interface Injector
      Returns:
    • getContext

      public ScopeContext getContext(Class<?> scope)
    • getValueSupplier

      protected <T extends Annotation> ValueSupplier<T,?> getValueSupplier(Class<T> annotation)
    • isScopeAnnotation

      protected boolean isScopeAnnotation(Class<? extends Annotation> annotationType)
    • isSingleton

      protected boolean isSingleton(Class<? extends Annotation> scopeAnnotationType)
    • getNameAnnotation

      protected Annotation getNameAnnotation(AnnotatedElement annotatedElement)