1 <?xml version="1.0" encoding="UTF-8"?> 2 <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 3 xmlns:util="http://www.springframework.org/schema/util" xmlns:p="http://www.springframework.org/schema/p" 4 xsi:schemaLocation=" 5 http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd 6 http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.0.xsd"> 7 8 <!-- the most powerful way --> 9 <bean id="yamlConstructor" class="examples.CustomConstructor" scope="prototype" /> 10 <bean id="yamlRepresenter" class="org.yaml.snakeyaml.representer.Representer" scope="prototype" /> 11 <bean id="yamlOptions" class="org.yaml.snakeyaml.DumperOptions" scope="prototype"> 12 <property name="indent" value="2" /> 13 </bean> 14 <bean id="snakeYaml" class="org.yaml.snakeyaml.Yaml" scope="prototype"> 15 <constructor-arg ref="yamlConstructor" /> 16 <constructor-arg ref="yamlRepresenter" /> 17 <constructor-arg ref="yamlOptions" /> 18 </bean> 19 20 <!-- for a single JavaBean --> 21 <bean id="beanConstructor" class="org.yaml.snakeyaml.constructor.Constructor" scope="prototype"> 22 <constructor-arg value="org.yaml.snakeyaml.Invoice" /> 23 </bean> 24 <bean id="javabeanYaml" class="org.yaml.snakeyaml.Yaml" scope="prototype"> 25 <constructor-arg ref="beanConstructor" /> 26 </bean> 27 28 <!-- the simplest way --> 29 <bean id="standardYaml" class="org.yaml.snakeyaml.Yaml" scope="prototype" /> 30 </beans>