Class DependencyInjectionHook

java.lang.Object
de.simonkerstan.ee.core.di.DependencyInjectionHook
All Implemented Interfaces:
ClassHook, ClassInterfacesHook, ConstructorHook, MethodHook

public class DependencyInjectionHook extends Object implements ClassHook, ClassInterfacesHook, ConstructorHook, MethodHook
Hook for dependency injection used by the class scanning mechanism.

FOR INTERNAL USE ONLY. THE API CAN CHANGE AT ANY TIME.

  • Constructor Details

    • DependencyInjectionHook

      public DependencyInjectionHook()
  • Method Details

    • getClassAnnotations

      public Class<? extends Annotation>[] getClassAnnotations()
      Description copied from interface: ClassHook
      Get all annotations at the class level processed by this hook.
      Specified by:
      getClassAnnotations in interface ClassHook
      Returns:
      Class annotations processed by this hook
    • getConstructorAnnotations

      public Class<? extends Annotation>[] getConstructorAnnotations()
      Description copied from interface: ConstructorHook
      Get all annotations at the constructor level processed by this hook.
      Specified by:
      getConstructorAnnotations in interface ConstructorHook
      Returns:
      Constructor annotations processed by this hook
    • getMethodAnnotations

      public Class<? extends Annotation>[] getMethodAnnotations()
      Description copied from interface: MethodHook
      Get all annotations at the method level processed by this hook.
      Specified by:
      getMethodAnnotations in interface MethodHook
      Returns:
      Method annotations processed by this hook
    • processClass

      public void processClass(Class<?> clazz, Class<? extends Annotation> annotation, Annotation annotationInstance)
      Description copied from interface: ClassHook
      Process the given class with the given annotation.
      Specified by:
      processClass in interface ClassHook
      Parameters:
      clazz - Class to be processed
      annotation - Annotation to be processed
      annotationInstance - Annotation instance to be processed
    • processClassInterfaces

      public void processClassInterfaces(Class<?> clazz, Class<?>[] interfaces)
      Description copied from interface: ClassInterfacesHook
      Process all interfaces directly implemented by the given class. This method will only be called for real classes, not for interfaces or other types.
      Specified by:
      processClassInterfaces in interface ClassInterfacesHook
      Parameters:
      clazz - Class to process
      interfaces - Directly implemented interfaces of the given class
    • processConstructor

      public void processConstructor(Constructor<?> constructor, Class<? extends Annotation> annotation, Annotation annotationInstance)
      Description copied from interface: ConstructorHook
      Process the given constructor with the given annotation.
      Specified by:
      processConstructor in interface ConstructorHook
      Parameters:
      constructor - Constructor to be processed
      annotation - Annotation to be processed
      annotationInstance - Annotation instance to be processed
    • processMethod

      public void processMethod(Method method, Class<? extends Annotation> annotation, Annotation annotationInstance)
      Description copied from interface: MethodHook
      Process the given method with the given annotation.
      Specified by:
      processMethod in interface MethodHook
      Parameters:
      method - Method to be processed
      annotation - Annotation to be processed
      annotationInstance - Annotation instance to be processed
    • addBeanProvider

      public void addBeanProvider(BeanProvider<?> beanProvider)
      Add a bean provider from a framework module.
      Parameters:
      beanProvider - Bean provider to be added
    • getBean

      public <T> T getBean(Class<T> clazz)
      Get an instantiated bean of the given class.
      Type Parameters:
      T - Bean type
      Parameters:
      clazz - Class of the bean
      Returns:
      Bean instance or null if not found
    • getBeans

      public Map<Class<?>,Object> getBeans()
      Get all instantiated beans.
      Returns:
      Beans
    • postProcess

      public void postProcess()
      Process all scanned classes and methods to create beans and contexts.