-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapplicationConstructorContext.xml
116 lines (101 loc) · 4.39 KB
/
applicationConstructorContext.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">
<!-- Constructor Demo -->
<bean id="employeeConBean" class="ConstructorDemo.EmployeeConBean">
<constructor-arg value="103" type="int"></constructor-arg>
<constructor-arg value="preeti"></constructor-arg>
<constructor-arg value="bangalore"></constructor-arg>
</bean>
<!-- Constructor Injection with dependent object -->
<bean id="a1" class="ConstructorWithDependent.Address">
<constructor-arg value="ghaziabad"></constructor-arg>
<constructor-arg value="UP"></constructor-arg>
<constructor-arg value="India"></constructor-arg>
</bean>
<bean id="employeeCidBean" class="ConstructorWithDependent.EmployeeCIDBean">
<constructor-arg value="104" type="int"></constructor-arg>
<constructor-arg value="sunny"></constructor-arg>
<constructor-arg>
<ref bean="a1" />
</constructor-arg>
</bean>
<!-- Constructor Injection with Collection List -->
<bean id="question" class="ConstructorWithCollectionList.Questions">
<constructor-arg value="111"></constructor-arg>
<constructor-arg value="What is java?"></constructor-arg>
<constructor-arg>
<list>
<value>Java is a programming language</value>
<value>Java is a Platform</value>
<value>Java is an Island of Indonasia</value>
</list>
</constructor-arg>
</bean>
<!-- Constructor Injection with Collection dependent object -->
<bean id="ans1" class="ConstructorWithCollectionDependent.Answer">
<constructor-arg value="1"></constructor-arg>
<constructor-arg value="Java is a programming language"></constructor-arg>
<constructor-arg value="John"></constructor-arg>
</bean>
<bean id="ans2" class="ConstructorWithCollectionDependent.Answer">
<constructor-arg value="2"></constructor-arg>
<constructor-arg value="Java is a Platform"></constructor-arg>
<constructor-arg value="Ravi"></constructor-arg>
</bean>
<bean id="ques" class="ConstructorWithCollectionDependent.Question">
<constructor-arg value="100"></constructor-arg>
<constructor-arg value="What is java?"></constructor-arg>
<constructor-arg>
<list>
<ref bean="ans1" />
<ref bean="ans2" />
</list>
</constructor-arg>
</bean>
<!-- Constructor Injection with Collection Map -->
<bean id="queue" class="ConstructorWithCollectionMap.Question">
<constructor-arg value="11"></constructor-arg>
<constructor-arg value="What is Java?"></constructor-arg>
<constructor-arg>
<map>
<entry key="Java is a Programming Language" value="Ajay Kumar"></entry>
<entry key="Java is a Platform" value="John Smith"></entry>
<entry key="Java is an Island" value="Raj Kumar"></entry>
</map>
</constructor-arg>
</bean>
<!-- Constructor Injection with Collection Map dependent object -->
<bean id="answer1" class="ConstructorWithMapDependent.Answer">
<constructor-arg value="1"></constructor-arg>
<constructor-arg value="Java is a Programming Language"></constructor-arg>
<constructor-arg value="05/22/2018"></constructor-arg>
</bean>
<bean id="answer2" class="ConstructorWithMapDependent.Answer">
<constructor-arg value="2"></constructor-arg>
<constructor-arg value="Java is a Platform"></constructor-arg>
<constructor-arg value="05/22/2018"></constructor-arg>
</bean>
<bean id="user1" class="ConstructorWithMapDependent.User">
<constructor-arg value="1"></constructor-arg>
<constructor-arg value="Arun Kumar"></constructor-arg>
<constructor-arg value="arun@gmail.com"></constructor-arg>
</bean>
<bean id="user2" class="ConstructorWithMapDependent.User">
<constructor-arg value="2"></constructor-arg>
<constructor-arg value="Varun Kumar"></constructor-arg>
<constructor-arg value="Varun@gmail.com"></constructor-arg>
</bean>
<bean id="rep" class="ConstructorWithMapDependent.Question">
<constructor-arg value="1"></constructor-arg>
<constructor-arg value="What is Java?"></constructor-arg>
<constructor-arg>
<map>
<entry key-ref="answer1" value-ref="user1"></entry>
<entry key-ref="answer2" value-ref="user2"></entry>
</map>
</constructor-arg>
</bean>
</beans>