Here is the @Bean source code:
@Target({ElementType.METHOD, ElementType.ANNOTATION_TYPE}) @Retention(RetentionPolicy.RUNTIME) @Documented public @interface Bean { @AliasFor("name") String[] value() default {}; @AliasFor("value") String[] name() default {}; Autowire autowire() default Autowire.NO; String initMethod() default ""; String destroyMethod() default "(inferred)"; }
I find that autowire's default value is Autowire.NO, but when I use this bean with @Autowired it still works, is it behavior by default or by some kind of convention?