Results 1 to 5 of 5

Thread: Creating a non-String keyed Map using

  1. #1
    Join Date
    Oct 2004
    Posts
    2

    Default Creating a non-String keyed Map using
    I'm trying to initialise a Map which is the value of a property on an instance using the <map> element. The required Map is a Class -> Class Map i.e. both keys and values are Classes. How would I do this in the xml config?

    (btw, the xml config is being read with XmlBeanFactory, if that matters)

    Ta,


  2. #2
    Join Date
    Oct 2004
    Posts
    9

    Default Was wondering the same thing myself

    I haven't found any solution to this problem yet.

  3. #3
    Join Date
    Aug 2004
    Posts
    2,715

    Default

    You cannot do that right now
    Spring configuration does currently allow for string keys in maps only. However, there exists already a jira issue which requests the extension to arbitrary types. So this issue should be solved in a future release.

    Regards,
    Andreas

  4. #4
    Join Date
    Oct 2004
    Posts
    2

    Default FYI: JIRA bug URL

    I'm glad someone else has found this to be a problem. FYI, the JIRA url is:
    http://opensource.atlassian.com/proj...browse/SPR-392

    Of course, the next question is: when is RC1 due out? ;-)

  5. #5
    Join Date
    Aug 2004
    Location
    Toronto, Canada
    Posts
    736

    Default

    In the meantime, (and it's not the cleanest looking solution, but it will work) it would probably take you about 10 minutes to create a new factory bean based off MapFactoryBean and ListFactoryBean, which given an input list consisting of alternating keys and values, would prodouce an output map... That would get you going at least...
    Colin Sampaleanu
    SpringSource - http://www.springsource.com

Similar Threads

  1. Replies: 8
    Last Post: Jul 13th, 2005, 11:20 AM
  2. Stack Overflow
    By rayho222 in forum Container
    Replies: 6
    Last Post: May 17th, 2005, 03:42 AM
  3. could not satisfy dependencies
    By springuser in forum Container
    Replies: 4
    Last Post: Apr 26th, 2005, 01:15 PM
  4. Replies: 1
    Last Post: Apr 25th, 2005, 07:37 PM
  5. DefaultAdvisorAutoProxyCreator skipping beans
    By youngm in forum Container
    Replies: 6
    Last Post: Apr 12th, 2005, 04:29 PM

Posting Permissions

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