Link to home
Start Free TrialLog in
Avatar of gudii9
gudii9Flag for United States of America

asked on

Wiring maps and properties

I was reading folowing line and I did not understand clearly.

Wiring maps
You can wire java util.Map collections in Spring using the <map> element. Map
collections are somewhat different than Lists, Sets. Each entry in a Map is
made up of a key and a value defined by the <entry> element:
The value of a map <entry>, just as with <list> and <set>, can be any valid property
element.

Again, this includes <value>, <ref>, <list>, or even another <map>.
When wiring an <entry>, notice that the key attribute will also be a String.
This is a slight limitation over the full functionality of java.util.Map, which
allows any object to be the key of a map entry. However, this limitation doesn’t
often present a problem, as Maps are typically keyed with Strings anyway.
Wiring properties
A java.util.Properties collection is the final type of collection that can be wired
in Spring. It is wired with the <props> element. Each element of a properties collection
is wired with the <prop> element.
In many ways, <props> works similarly to <map>. The big difference is that the
value of a <prop> entry is always a String, so there is no need to use the..

Any ideas, resources,sample code,links, highly appreciated. thanks in advance.
Avatar of Mick Barry
Mick Barry
Flag of Australia image

Its just saying the key should be a String
Avatar of gudii9

ASKER

>>Its just saying the key should be a String

for Property or Map. please advise
ASKER CERTIFIED SOLUTION
Avatar of Mick Barry
Mick Barry
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial