<?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
https://www.springframework.org/schema/beans/spring-beans.xsd">
<bean id="address" class="com.yao.pojo.Address">
<property name="address" value="哈尔滨"></property>
</bean>
<bean id="student" class="com.yao.pojo.Student">
<!-- 第一种 普通值注入 value -->
<property name="name" value="詹姆斯"></property>
<!-- 第二种 bean 注入 ref-->
<property name="address" ref="address"></property>
<!-- 第三种 数组注入-->
<property name="books">
<array>
<value>水浒传</value>
<value>西游记</value>
<value>红楼梦</value>
<value>三国演义</value>
</array>
</property>
<!-- 第四种list-->
<property name="hobbies">
<list>
<value>抽烟</value>
<value>喝酒</value>
<value>烫头</value>
</list>
</property>
<!-- map-->
<property name="card">
<map>
<entry key="学生卡" value="18140202"></entry>
<entry key="身份证" value="410883111111111111"></entry>
</map>
</property>
<!-- set-->
<property name="games">
<set>
<value>lol</value>
<value>csgo</value>
</set>
</property>
<!-- null-->
<property name="wife">
<null></null>
</property>
<!-- properties-->
<property name="info">
<props>
<prop key="学号">1008611</prop>
<prop key="性别">男</prop>
</props>
</property>
</bean>
</beans>