Reputation: 21924
Is there some kind of bean factory or static class that I can use within a Spring configuration file to create an instance of a Java class and set its properties? Something like this:
<bean id="myThingy" class="org.whatever.specialBeanMaker">
<property class="${maven.filtered.property.value}" />
<properties>
<property name="a" value="...." />
<property name="b" value="...." />
<property name="c" value="...." />
</properties>
</bean>
In other words, I need to make a bean from a class I won't know until runtime (because of filtering, JNDI, propertyPlaceholderConfigurer, etc.
Upvotes: 1
Views: 910
Reputation: 128849
No need for anything special. Just do it like you'd expect:
<bean class="${whateverClass}"/>
Upvotes: 2