Hi,
I'm just trying to explore one use case of using object as a value in a spring map. Here's my example
<util:map id="someSourceMap" map-class="java.util.HashMap">
<entry key="source1" value="testLine"/>
<entry key="source2" value="testLine2"/>
</util:map>
<bean id="testLine1" class="com.test.ProductLineMetadata" scope="prototype">
<constructor-arg value="PRODUCT_LINE_1"></constructor-arg>
<constructor-arg value="TYPE_1"></constructor-arg>
</bean>
<bean id="testLine2" class="com.test.ProductLineMetadata"scope="prototype">
<constructor-arg value="PRODUCT_LINE_2"></constructor-arg>
<constructor-arg value="TYPE_2"></constructor-arg>
</bean>
What I'm trying to achieve is to create a map in which the value will be a new instance of ProductLineMetadata object with different parameters set through constructor argument. I don't want to create a separate bean entry for each key with the desired constructor values. Is there a better way of doing this by somehow specifying the parameters inside the map declaration itself?
Any pointer will be highly appreciated.
Thanks