8.4. Creating beans from builder classes
You can create a bean created from another builder class as shown below:
Builder XML
<bean name="myBean" type="com.acme.MyBean"
builderClass="com.acme.MyBeanBuilder" builderMethod="createMyBean">
<properties>
<property key="id" value="123"/>
<property key="name" value="Acme"/>
</constructors>
</bean>
참고
You must make the builder class public with a no-arg default constructor.
You can then use the builder class to create the actual bean by using fluent builder style configuration.
Set the properties on the builder class, and create the bean by invoking the builderMethod at the end.
You invocate this method via Java reflection.