I have a spring bean (let's call it MagicBean) that has HashSet<String>as one of its properties.
I know how to initialize such a set:
<bean id="mySet" class="org.springframework.beans.factory.config.SetFactoryBean">
<property name="targetSetClass" value="java.util.HashSet"/>
<property name="sourceSet">
<set>
<value>Value 1</value>
<value>Value 2</value>
<value>Value 3</value>
</set>
</property>
</bean>
<bean id="magicBean" class="MagicBean">
<property name="mySet" ref="mySet"/>
</bean>
Is there a way to set values ββin a set using values ββfrom .properties, instead of hard-coding those values ββin xml?
Update 1:
Since I may have a different number of values ββfor this set in different environments, using a hard-coded set in xml will not work. Therefore, I need to somehow extract these values ββfrom the properties file.
2:
, .properties, MagicBean. Java- .
?