1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.springframework.oxm.config;
18
19 import org.w3c.dom.Element;
20
21 import org.springframework.beans.factory.support.BeanDefinitionBuilder;
22 import org.springframework.beans.factory.xml.AbstractSingleBeanDefinitionParser;
23 import org.springframework.beans.factory.xml.ParserContext;
24 import org.springframework.util.StringUtils;
25
26
27
28
29
30
31
32 class XmlBeansMarshallerBeanDefinitionParser extends AbstractSingleBeanDefinitionParser {
33
34 public static final String XML_BEANS_MARSHALLER_CLASS_NAME = "org.springframework.oxm.xmlbeans.XmlBeansMarshaller";
35
36 protected String getBeanClassName(Element element) {
37 return XML_BEANS_MARSHALLER_CLASS_NAME;
38 }
39
40 protected void doParse(Element element, ParserContext parserContext, BeanDefinitionBuilder beanDefinitionBuilder) {
41 String optionsName = element.getAttribute("options");
42 if (StringUtils.hasText(optionsName)) {
43 beanDefinitionBuilder.addPropertyReference("xmlOptions", optionsName);
44 }
45 }
46 }