Announcement Announcement Module
Collapse
No announcement yet.
Adding extra key/value pair to bean's property Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Adding extra key/value pair to bean's property

    Hi,

    I have a bean with a map property. I'd like to add extra key/value pairs to the bean's property after the bean's definition.

    I am using the "classpath:*:" style syntax to find my bean definitions. I want to plugin extra key/value pairs in additional files that are found in the classpath as runtime.

    Is this possible?

    e.g. I wich I could do something like this:

    In mybeans.xml

    <bean id="nicebean">
    <property name="handlers">
    <map>
    <entry key="polite" value-ref="com.nice.PoliteHandler" />
    <entry key="cordial" value-ref="com.nice.CordialHandler" />
    </map>
    </property>
    </bean>


    Then in a plugin included at runtime I might want add something more

    In extrabeans.xml:

    <bean id="nicebean" modify="true">
    <property name="handlers">
    <map>
    <entry key="fawning" value-ref="com.nice.FawningHandler" />
    </map>
    </property>
    </bean>


    I have already checked the Collection Merging feature. It seems be about creating new collections from existing ones rather than modifying existing ones.

    Any ideas?

    Thanks in advance,
    David
Working...
X