Instantiation using an instance factory method
There is provision where factory method of an existing bean from the container can be the factory bean, which contains a method called createInstance().
To use this technique the 'class' attributes must be left empty, and the 'factory-bean' attribute will specify the name of a bean in the current or lower bean factory which contains the factory method. The factory method is set via the 'factory-method' attribute
Following code will give more clarity:
Where abcBean contains createObject method
<bean id="abcBean" class="...">
<!-- the bean to be created via the factory bean -->
<bean id="sampleBean" factory-bean="abcBean" factory-method="createObject"/>