Can spring find implementation of interfaces without @Component(and other) annotations on class, and without explicit bean declaration in xml? Just scan packages and find class that implement interface?
From Spring doc
By default, classes annotated with @Component, @Repository, @Service, @Controller, or a custom annotation that itself is annotated with @Component are the only detected candidate components. However, you can modify and extend this behavior simply by applying custom filters. Add them as include-filter or exclude-filter sub-elements of the component-scan element. Each filter element requires the type and expression attributes. The following table describes the filtering options.
Table 3.5. Filter Types
assignable | org.example.SomeClass | A class (or interface) that the target components are assignable to (extend/implement).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With