Wiring maps and properties

Posted on 2011-05-04
Last Modified: 2012-05-11
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

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.
Question by:gudii9
    LVL 92

    Expert Comment

    Its just saying the key should be a String
    LVL 7

    Author Comment

    >>Its just saying the key should be a String

    for Property or Map. please advise
    LVL 92

    Accepted Solution


    for properties the value must also be a string

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Join & Write a Comment

    Suggested Solutions

    Title # Comments Views Activity
    Multiple issues with Java 14 37
    Fix45 challenge 15 66
    countHi2 challenge 7 30
    mapShare challenge 13 40
    For customizing the look of your lightweight component and making it look lucid like it was made of glass. Or: how to make your component more Apple-ish ;) This tip assumes your component to be of rectangular shape and completely opaque. (COD…
    Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
    Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
    Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:

    730 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now