Class SetterBeanInjection

java.lang.Object
com.bobocode.bring.core.context.impl.SetterBeanInjection

public class SetterBeanInjection extends Object
Responsible for injecting dependencies into setter methods of a bean using the @Autowired annotation. Handles setter-based dependency injection for annotated setter methods within a class.
Since:
1.0
Author:
Blyzhnytsia Team
  • Field Details

  • Constructor Details

    • SetterBeanInjection

      public SetterBeanInjection()
  • Method Details

    • injectViaSetter

      public void injectViaSetter(Class<?> clazz, Object bean)
      Injects dependencies into setter methods of the provided class instance based on the @Autowired annotation.
      Parameters:
      clazz - The class whose setter methods are to be injected with dependencies.
      bean - The instance of the class whose setter methods are being injected.
    • injectDependencyViaMethod

      private void injectDependencyViaMethod(Method method, Object bean)
      Injects a dependency into a specific setter method of the provided bean instance.
      Parameters:
      method - The setter method to be injected with a dependency.
      bean - The instance of the class whose setter method is being injected.
    • injectDependencyViaParameter

      private Object injectDependencyViaParameter(Method method, Parameter parameter, Object bean, ParameterValueTypeInjector valueType)
      Injects a dependency into the setter method parameter of the provided bean instance.
      Parameters:
      method - The setter method where the parameter is to be injected with a dependency.
      parameter - The parameter to be injected with a dependency.
      bean - The instance of the class whose setter method is being injected.
      valueType - The ParameterValueTypeInjector responsible for setting the parameter value.
      Returns:
      The injected dependency object.