instantiate spring bean via factory method

Posted by Don on Stack Overflow See other posts from Stack Overflow or by Don
Published on 2010-04-27T07:15:08Z Indexed on 2010/04/27 7:23 UTC
Read the original article Hit count: 319

Filed under:
|
|

Hi,

I need to instantiate a Spring bean in the same manner as this Java code:

MyClass foo = Mockito.mock(MyClass.class);

The XML I need will look something like:

<bean id="foo" class="Mockito" factory-method="mock">
    <constructor-arg value="MyClass"/>
</bean>

I can't seem to find the correct syntax for passing a Class object as a parameter to the factory method.

Thanks, Don

© Stack Overflow or respective owner

Related posts about spring

Related posts about java