Class SetterBeanInjection
java.lang.Object
com.bobocode.bring.core.context.impl.SetterBeanInjection
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 Summary
FieldsModifier and TypeFieldDescriptionprivate final AnnotationBringBeanRegistry
private final ClassPathScannerFactory
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate void
injectDependencyViaMethod
(Method method, Object bean) Injects a dependency into a specific setter method of the provided bean instance.private Object
injectDependencyViaParameter
(Method method, Parameter parameter, Object bean, ParameterValueTypeInjector valueType) Injects a dependency into the setter method parameter of the provided bean instance.void
injectViaSetter
(Class<?> clazz, Object bean) Injects dependencies into setter methods of the provided class instance based on the @Autowired annotation.
-
Field Details
-
beanRegistry
-
classPathScannerFactory
-
-
Constructor Details
-
SetterBeanInjection
public SetterBeanInjection()
-
-
Method Details
-
injectViaSetter
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
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.
-