Java Tutorial/Spring/ConfigurableListableBeanFactory

Материал из Java эксперт
Перейти к: навигация, поиск

Use ConfigurableListableBeanFactory

File: context.xml



<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="
                http://www.springframework.org/schema/beans
                http://www.springframework.org/schema/beans/spring-beans.xsd">
    <bean id="customEditorConfigurer" class="org.springframework.beans.factory.config.CustomEditorConfigurer">
        <property name="customEditors">
            <map>
                <entry key="java.lang.Double">
                    <bean class="ComplexPropertyEditor"/>
                </entry>
            </map>
        </property>
    </bean>
    <bean id="exampleBean" class="CustomEditorDemo">
        <property name="values">
            <list>
                <value>10</value>
                <value>-10</value>
                <value>10</value>
            </list>
        </property>
    </bean>
</beans>