File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11package org .baeldung .web ;
22
3- import org .springframework .beans .factory .InitializingBean ;
43import org .springframework .stereotype .Component ;
54
65@ Component
7- public class BeanA implements InitializingBean {
6+ public class BeanA {
87
9- // @Autowired
10- // private IBeanC dependency;
8+ private IBeanC dependency ;
119
1210 public BeanA () {
1311 super ();
1412 }
1513
1614 //
1715
18- @ Override
19- public void afterPropertiesSet () throws Exception {
20- System .out .println ();
21- // throw new NullPointerException();
22- }
23-
2416}
Original file line number Diff line number Diff line change 33import org .springframework .stereotype .Component ;
44
55@ Component
6- public class BeanC implements IBeanC {
6+ public class BeanB implements IBeanB {
77
8- public BeanC () {
8+ public BeanB () {
99 super ();
1010 }
1111
Original file line number Diff line number Diff line change 33import org .springframework .stereotype .Component ;
44
55@ Component
6- public class BeanB1 implements IBeanB {
6+ public class BeanC1 implements IBeanC {
77
8- public BeanB1 () {
8+ public BeanC1 () {
99 super ();
1010 }
1111
Original file line number Diff line number Diff line change 33import org .springframework .stereotype .Component ;
44
55@ Component
6- public class BeanB2 implements IBeanB {
6+ public class BeanC2 implements IBeanB {
77
8- public BeanB2 () {
8+ public BeanC2 () {
99 super ();
1010 }
1111
Original file line number Diff line number Diff line change 11package org .baeldung .web ;
22
3- public abstract class BeanD implements IBeanD {
3+ import org .springframework .stereotype .Component ;
4+
5+ @ Component
6+ public class BeanD implements IBeanD {
47
58 public BeanD () {
69 super ();
Original file line number Diff line number Diff line change 44 http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
55 http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.2.xsd" >
66
7- <bean id =" beanD" class =" org.baeldung.web.BeanD" />
7+ <bean id =" beanA" class =" org.baeldung.web.BeanA" >
8+ <property name =" beanC" ref =" beanC" />
9+ </bean >
810
911</beans >
You can’t perform that action at this time.
0 commit comments