I want to use static values from a class as value for key
for a props
in spring bean configuration file. Here is an excerpt from my spring bean config file
<property name="serviceMappings">
<props>
<prop key="portraitMode">portraitMode</prop>
<prop key="landscapeMode">landscapeMode</prop>
</props>
</property>
<bean id="portraitMode" class="com.xyz.PortraitMode">
<propery name="someDependency" ref="someDependency" />
</bean>
<bean id="landscapeMode" class="com.xyz.landscapeMode">
<propery name="someDependency" ref="someDependency" />
</bean>
Now instead of using hard coded values "portraitMode"
and "landscapeMode"
while creating serviceMappings
I want these values to come from constants defined in another class. Is there a way to do this in Spring ?