1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.springframework.ws.config;
18
19 import java.util.List;
20 import java.util.Properties;
21
22 import org.springframework.beans.factory.support.BeanDefinitionBuilder;
23 import org.springframework.beans.factory.xml.AbstractSimpleBeanDefinitionParser;
24 import org.springframework.beans.factory.xml.ParserContext;
25 import org.springframework.util.xml.DomUtils;
26
27 import org.w3c.dom.Element;
28
29
30
31
32
33
34
35
36 @Deprecated
37 class XPathEndpointsBeanDefinitionParser extends AbstractSimpleBeanDefinitionParser {
38
39 private static final String XPATH_PARAM_ANNOTATION_METHOD_ENDPOINT_ADAPTER_CLASS_NAME =
40 "org.springframework.ws.server.endpoint.adapter.XPathParamAnnotationMethodEndpointAdapter";
41
42 @Override
43 protected boolean shouldGenerateIdAsFallback() {
44 return true;
45 }
46
47 @Override
48 protected String getBeanClassName(Element element) {
49 return XPATH_PARAM_ANNOTATION_METHOD_ENDPOINT_ADAPTER_CLASS_NAME;
50 }
51
52 @Override
53 protected void doParse(Element element, ParserContext parserContext, BeanDefinitionBuilder beanDefinitionBuilder) {
54 List<Element> namespaceElements = DomUtils.getChildElementsByTagName(element, "namespace");
55 if (!namespaceElements.isEmpty()) {
56 Properties namespaces = new Properties();
57 for (Element namespaceElement : namespaceElements) {
58 String prefix = namespaceElement.getAttribute("prefix");
59 String uri = namespaceElement.getAttribute("uri");
60 namespaces.setProperty(prefix, uri);
61 }
62 beanDefinitionBuilder.addPropertyValue("namespaces", namespaces);
63 }
64 }
65
66 }