Create bean of type Set<Class<?>>
spring
Solution
If you really wanted to do what you describe, then you can do it like this:
<bean id="myClass" class="java.lang.Class" factory-method="forName">
<constructor-arg value="com.MyClass"/>
</bean>
But as @ChssPly76 said, if you want to inject it into another bean, you only need inject the class name, and Spring will auto-convert it into a class instance for you.
Problem
How can I create a bean of type Class? I found a way using getClass() but that requires an instance and cannot be used via factory-method since it is not static. It also requires an extraneous bean be created for this express purpose: ``` <bean id="foo" class="Foo" /> <bean id="fooClass" factory-bean="foo" factory-method="getClass" /> ``` This isn't so bad if the Foo class is easy to construct, but what if the constructor has required parameters? I then need to create a Set of Class to wire into another bean via a property. I would create the Set such as: ``` <util:set id="classSet"> <ref local="fooClass"/> </util:set> ```