PDA

View Full Version : Reference as class not object



lukasbradley
Feb 22nd, 2009, 03:57 PM
Is there a way to define a bean/reference as the class of an object type, and not a single object reference?

For example, this is what I effectively want:



<bean id="endpointCreateRequest_class" class="my.path.to.MyWhatever.class" />


Is something like this possible?

vincent_ray21
Feb 24th, 2009, 06:22 AM
You can try this (workaround):



<bean id="endpointCreateRequest_class" class="java.lang.Class" factory-method="forName">
<constructor-arg value="my.path.to.MyWhatever"/>
</bean>


HTH,
Vincent

al0
Feb 24th, 2009, 07:59 AM
Sorry, but it is not very clear from explanation, what you want (and what for). May you elaborate some more?

Is there a way to define a bean/reference as the class of an object type, and not a single object reference?

For example, this is what I effectively want:



<bean id="endpointCreateRequest_class" class="my.path.to.MyWhatever.class" />


Is something like this possible?