What's the best way to create a bean for a HashMap<Class,String
>?
Specifically, do I need to explicitly create a Class bean for the key or is the class name enough?
What's the best way to create a bean for a HashMap<Class,String
>?
Specifically, do I need to explicitly create a Class bean for the key or is the class name enough?
If you mean a Map
, where you don't mind which implementation, rather than specifically a HashMap
, then use <util:map>
(see section A.2.2.5 of the docs). That will likely create you something like a LinkedHashMap
, which is probably good enough.
If you really want an actual HashMap
, then you can specify the map-class
attribute of <util:map>
as "java.util.HashMap"
.