|
From: Rob H. <rob...@in...> - 2005-10-22 15:53:06
|
That's not a bad idea - can you raise an JIRA issue for this? Also, in
Spring 1.3 we will actually autodetect the element types when using
generics definitions like you have here so you won't need to specify the
element types.
Rob
Peter Backlund wrote:
>Hello.
>
>Would it make sense to add key-class and value-class attributes to the
><map> element, and feed the strings in the key/value elements (or
>attributes) to the appropriate PropertyEditor, to allow setting key and
>value of the correct class when using maps with generics?
>
>For example, consider this example:
>
>public Map<Locale, String> getHeadsOfState() { ... }
>
>configured like this:
>
><property name="headsOfState">
> <map key-class="java.util.Locale" value-class="java.lang.String">
> <entry key="en_US" value="George W. Bush"/>
> <entry key="en_GB" value="Tony Blair"/>
> <entry key="sv_SE" value="Göran Persson"/>
> </map>
></property>
>
>I've glanced at modifying the xml parsing and subclassing or modifying
>MapFactoryBean, but I thought I'd ask here first if it's possible to do
>this any other way, or if it's a bad idea altogether.
>
>What do you think?
>
>/Peter Backlund
>
>
>
>
>
>-------------------------------------------------------
>This SF.Net email is sponsored by:
>Power Architecture Resource Center: Free content, downloads, discussions,
>and more. http://solutions.newsforge.com/ibmarch.tmpl
>_______________________________________________
>Springframework-developer mailing list
>Spr...@li...
>https://lists.sourceforge.net/lists/listinfo/springframework-developer
>
>
--
Rob Harrop
Principal Consultant
Interface21 - Spring Services from the Source
http://www.springframework.com
|