1 Public classorderservicebean{2 PrivateSet<string> sets =NewHashset<string>();3 Privatelist<string> lists =NewArraglist<string>();4 PrivateProperties Properties =NewProperties ();5 PrivateMap<string,string> maps =NewHashmap<string,string>();6 7...//getter and setter methods for omitting attributes8}
Assemble the Set set (the list assembly method is similar):
1 <property name = "Sets" >2 <set>3 <value> First </value> 4 <value> a second </value>5 <value> third </value>6 </set>7 </property>
To assemble the Properties collection:
1 <property name= "Properties" >2 <props>3 <prop key= "Key1" > Vlaue1</prop>4 <prop key= "Key2" >vlaue2</prop>5 <prop key= "Key3" >value3</prop>6 <props>7 </property>
To assemble a map collection:
1 <property name= "Maps" >2 <map>3 <entry key= "key-1" value= " Value-1 "/>4 <entry key=" key-2 "value=" Value-2 "/>5 <entry key=" key-3 "value=" Value-3 "/>6 </map>7 </property>
How spring assembles various collection examples