0

I have a bean (com.test.map) as below which is being used at many places, I want to include a new entry to the list but I should not modify anything to below bean.

<bean name="com.test.map" class="java.util.LinkedHashMap">
  <constructor-arg index="0">
    <map>
      <entry key="1" value="One" />
      <entry key="2" value="Two" />
    </map> 
  </constructor-arg>
<bean>

I want to extend the above bean by appending a new entry parameter which can be used at other place. Any help is appreciated to validate if new bean is valid in extending?

<bean name="com.test.extendmap" parent="com.test.map">
  <constructor-arg>
    <map>
      <entry key="3" value="Three" />
    </map> 
  </constructor-arg>
<bean>
Nagaraj
  • 78
  • 8

0 Answers0