|
From: Peter B. <pet...@ho...> - 2005-10-22 18:52:44
|
On Sat, 2005-10-22 at 16:52 +0100, Rob Harrop wrote:
> 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.
Sure, but would that really be necessary if you can autodetect it in
1.3? Besides, is it possible to detect generics definitions in bytecode?
I was under the impression that it wasn't possible, or will it require
processing of the corresponding source code?
/Peter
>
> 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
> >
> >
>
|