diff --git a/core/src/main/java/com/bobocode/bring/core/annotation/Autowired.java b/core/src/main/java/com/bobocode/bring/core/annotation/Autowired.java index 3041c240..5b5056f1 100644 --- a/core/src/main/java/com/bobocode/bring/core/annotation/Autowired.java +++ b/core/src/main/java/com/bobocode/bring/core/annotation/Autowired.java @@ -10,31 +10,21 @@ * This annotation can be applied to fields, constructors, and methods in a Bring bean class to let Bring automatically * inject the dependencies at runtime. * - *
When applied to a field, the Bring IoC container will automatically inject a compatible bean, resolved by type, + * When applied to a field, the Bring IoC container will automatically inject a compatible bean, resolved by type, * into the annotated field. When applied to a constructor, the container will use constructor injection to provide * the required dependencies. If applied to a method, the container will invoke the method after initializing the bean, * injecting the necessary dependencies into the method parameters. * - *
This annotation is part of the Bring Framework's dependency injection mechanism, enabling the creation of loosely + * This annotation is part of the Bring Framework's dependency injection mechanism, enabling the creation of loosely * coupled and easily testable components. * - *
Usage Example: - *
- * {@code - * @Component - * public class MyComponent { + * When we have a class possesses only one constructor, explicitly adding the @Autowired annotation isn't mandatory. + * Bring inherently knows which constructor to invoke and handles it accordingly. * - * @Autowired - * private MyDependency myDependency; - * - * // Constructors and methods can also be annotated - * @Autowired - * public MyComponent(MyDependency myDependency) { - * this.myDependency = myDependency; - * } - * } - * } - *+ * For classes with multiple constructors, it becomes imperative to specify to Bring which constructor should be utilized + * through the @Autowired annotation. This annotation acts as a directive for Bing to identify + * and use the designated constructor to resolve dependencies properly. + * This way, when Bring encounters multiple constructors within a class, the @Autowired annotation guides it in selecting the appropriate constructor for dependency resolution. * * @author Blyzhnytsia Team * @since 1.0 diff --git a/core/src/main/java/com/bobocode/bring/core/annotation/BeanProcessor.java b/core/src/main/java/com/bobocode/bring/core/annotation/BeanProcessor.java index 7a841b61..4e80994d 100644 --- a/core/src/main/java/com/bobocode/bring/core/annotation/BeanProcessor.java +++ b/core/src/main/java/com/bobocode/bring/core/annotation/BeanProcessor.java @@ -9,7 +9,8 @@ * Annotation used to mark extensions for custom scanners, resolvers, or processors in the client's application. * These extensions can be used to perform specific tasks related to bean scanning, resolving, or processing. * In addition, we have some limitation on constructor some of the classes should have only default or one field. - * for instance RestControllerBeanPostProcessor + * for instance RestControllerBeanPostProcessor. + * This limitation only for customization scanners, resolvers, or processors * * @author Blyzhnytsia Team * @since 1.0 diff --git a/core/src/main/java/com/bobocode/bring/core/bfpp/BeanPostProcessorDefinitionFactory.java b/core/src/main/java/com/bobocode/bring/core/bfpp/BeanPostProcessorDefinitionFactory.java index 68d5f561..635f004c 100644 --- a/core/src/main/java/com/bobocode/bring/core/bfpp/BeanPostProcessorDefinitionFactory.java +++ b/core/src/main/java/com/bobocode/bring/core/bfpp/BeanPostProcessorDefinitionFactory.java @@ -43,7 +43,7 @@ public class BeanPostProcessorDefinitionFactory { /** * The list of bean factory post-processors created by this factory. */ - private final List