Results 1 to 4 of 4

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

  1. #1
    Join Date
    Aug 2005
    Location
    Lexington, KY
    Posts
    36

    Default 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.
    Jamie Bisotti

  2. #2
    Join Date
    Aug 2005
    Location
    Lexington, KY
    Posts
    36

    Default

    Can somene comment on this? Please.
    Jamie Bisotti

  3. #3
    Join Date
    Aug 2005
    Location
    Lexington, KY
    Posts
    36

    Default

    Anyone...anyone?
    Jamie Bisotti

  4. #4
    Join Date
    Oct 2004
    Location
    Fareham, England
    Posts
    313

    Default

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •