Announcement Announcement Module
Collapse
No announcement yet.
Can <util:map> be used for inner beans? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Can <util:map> be used for inner beans?

    If I need a TreeMap whose entry values are also TreeMaps, can I use <util:map> for the inner TreeMaps, or do I still have to use the old, verbose method? Seems like 'id' is required, which defeats the purpose of inner beans, doesn't it?

    Thanks.

  • #2
    Can somene comment on this? Please.

    Comment


    • #3
      Anyone...anyone?

      Comment


      • #4
        Hi

        In a word, no. A quick gander at the relevant source code (MapBeanDefinitionParser) reveals this (somewhat opaque) comment (which tells me the 'what' of what I need to know, but not the 'why').

        Code:
        // cannot be used in a 'inner-bean' setting (use plain <map>)
        Which in your use case is a shame, because being able to specify the Map class (Set class, List class, etc.) would be nice. I'll have a shot at addressing this in the Spring 2.1 timeframe(or perhaps sooner after I've had a gas about it with Rob).

        In the interim (possibly forever), you'll have to use the old school style (ListFactoryBean in your case).

        Cheers
        Rick

        Comment

        Working...
        X