Getting Started 10 - Collection Object Injection
For collections such as array, java.util.list, java.util.set, java.util.map, etc., you must fill in some objects to a collection before the injection, then inject the collection object into the desired Bean. For example, if there is a bean as follows:
Somebean.java
Public class somebean {
PRIVATE STRING [] Somestrarray;
PRIVATE SOMEOBJ [] Someobjarray;
PRIVATE List Somelist;
PRIVATE MAP SOMEMAP;
....
}
For this demand, Spring can also help you maintain, directly to see how the bean definition file is set:
list>
Property>
list>
Property>
list>
Property>
entry>
entry>
map>
Property>
bean>
beans>
The above bean definition file is a comprehensive demonstration, and the array is set with the volume, and the Map object uses the
set>
You can also inject java.util.properties, bean definition files to demonstrate as follows: ....
....
SomeProvalue1
prop>
SomeProvalue2
prop>
prOPS>
Property>
bean>
....