@@ -74,73 +74,71 @@ else if ("ref".equals(childElement.getLocalName())) {
74
74
75
75
}
76
76
else if ("payloadRoot" .equals (childElement .getLocalName ())) {
77
- // bean elements
78
- List <Element > beanElements = DomUtils .getChildElementsByTagName (childElement , "bean" );
79
- for (Element beanElement : beanElements ) {
80
- RootBeanDefinition smartInterceptorDef =
81
- createSmartInterceptorDefinition (PayloadRootSmartSoapEndpointInterceptor .class , childElement ,
82
- parserContext );
83
- BeanDefinitionHolder interceptorDef = createInterceptorDefinition (parserContext , beanElement );
84
-
85
- String namespaceUri = childElement .getAttribute ("namespaceUri" );
86
- String localPart = childElement .getAttribute ("localPart" );
87
-
88
- smartInterceptorDef .getConstructorArgumentValues ().addIndexedArgumentValue (0 , interceptorDef );
89
- smartInterceptorDef .getConstructorArgumentValues ().addIndexedArgumentValue (1 , namespaceUri );
90
- smartInterceptorDef .getConstructorArgumentValues ().addIndexedArgumentValue (2 , localPart );
91
-
92
- registerSmartInterceptor (parserContext , smartInterceptorDef );
93
- }
94
-
95
- // ref elements
96
- List <Element > refElements = DomUtils .getChildElementsByTagName (childElement , "ref" );
97
- for (Element refElement : refElements ) {
98
- RootBeanDefinition smartInterceptorDef =
99
- createSmartInterceptorDefinition (PayloadRootSmartSoapEndpointInterceptor .class , childElement ,
100
- parserContext );
101
- BeanReference interceptorRef = createInterceptorReference (parserContext , refElement );
102
-
103
- String namespaceUri = childElement .getAttribute ("namespaceUri" );
104
- String localPart = childElement .getAttribute ("localPart" );
105
-
106
- smartInterceptorDef .getConstructorArgumentValues ().addIndexedArgumentValue (0 , interceptorRef );
107
- smartInterceptorDef .getConstructorArgumentValues ().addIndexedArgumentValue (1 , namespaceUri );
108
- smartInterceptorDef .getConstructorArgumentValues ().addIndexedArgumentValue (2 , localPart );
109
-
110
- registerSmartInterceptor (parserContext , smartInterceptorDef );
77
+ List <Element > payloadRootChildren = DomUtils .getChildElements (childElement );
78
+ for (Element payloadRootChild : payloadRootChildren ) {
79
+ if ("bean" .equals (payloadRootChild .getLocalName ())) {
80
+ RootBeanDefinition smartInterceptorDef =
81
+ createSmartInterceptorDefinition (PayloadRootSmartSoapEndpointInterceptor .class ,
82
+ childElement , parserContext );
83
+ BeanDefinitionHolder interceptorDef =
84
+ createInterceptorDefinition (parserContext , payloadRootChild );
85
+
86
+ String namespaceUri = childElement .getAttribute ("namespaceUri" );
87
+ String localPart = childElement .getAttribute ("localPart" );
88
+
89
+ smartInterceptorDef .getConstructorArgumentValues ().addIndexedArgumentValue (0 , interceptorDef );
90
+ smartInterceptorDef .getConstructorArgumentValues ().addIndexedArgumentValue (1 , namespaceUri );
91
+ smartInterceptorDef .getConstructorArgumentValues ().addIndexedArgumentValue (2 , localPart );
92
+
93
+ registerSmartInterceptor (parserContext , smartInterceptorDef );
94
+ }
95
+ else if ("ref" .equals (payloadRootChild .getLocalName ())) {
96
+ RootBeanDefinition smartInterceptorDef =
97
+ createSmartInterceptorDefinition (PayloadRootSmartSoapEndpointInterceptor .class ,
98
+ childElement , parserContext );
99
+ BeanReference interceptorRef = createInterceptorReference (parserContext , payloadRootChild );
100
+
101
+ String namespaceUri = childElement .getAttribute ("namespaceUri" );
102
+ String localPart = childElement .getAttribute ("localPart" );
103
+
104
+ smartInterceptorDef .getConstructorArgumentValues ().addIndexedArgumentValue (0 , interceptorRef );
105
+ smartInterceptorDef .getConstructorArgumentValues ().addIndexedArgumentValue (1 , namespaceUri );
106
+ smartInterceptorDef .getConstructorArgumentValues ().addIndexedArgumentValue (2 , localPart );
107
+
108
+ registerSmartInterceptor (parserContext , smartInterceptorDef );
109
+ }
111
110
}
112
111
}
113
112
else if ("soapAction" .equals (childElement .getLocalName ())) {
114
- // bean elements
115
- List <Element > beanElements = DomUtils .getChildElementsByTagName (childElement , "bean" );
116
- for (Element beanElement : beanElements ) {
117
- RootBeanDefinition smartInterceptorDef =
118
- createSmartInterceptorDefinition (SoapActionSmartEndpointInterceptor .class , childElement ,
119
- parserContext );
120
- BeanDefinitionHolder interceptorDef = createInterceptorDefinition (parserContext , beanElement );
121
-
122
- String soapAction = childElement .getAttribute ("value" );
123
-
124
- smartInterceptorDef .getConstructorArgumentValues ().addIndexedArgumentValue (0 , interceptorDef );
125
- smartInterceptorDef .getConstructorArgumentValues ().addIndexedArgumentValue (1 , soapAction );
126
-
127
- registerSmartInterceptor (parserContext , smartInterceptorDef );
128
- }
129
-
130
- // ref elements
131
- List <Element > refElements = DomUtils .getChildElementsByTagName (childElement , "ref" );
132
- for (Element refElement : refElements ) {
133
- RootBeanDefinition smartInterceptorDef =
134
- createSmartInterceptorDefinition (SoapActionSmartEndpointInterceptor .class , childElement ,
135
- parserContext );
136
- BeanReference interceptorRef = createInterceptorReference (parserContext , refElement );
137
-
138
- String soapAction = childElement .getAttribute ("value" );
139
-
140
- smartInterceptorDef .getConstructorArgumentValues ().addIndexedArgumentValue (0 , interceptorRef );
141
- smartInterceptorDef .getConstructorArgumentValues ().addIndexedArgumentValue (1 , soapAction );
142
-
143
- registerSmartInterceptor (parserContext , smartInterceptorDef );
113
+ List <Element > soapActionChildren = DomUtils .getChildElements (childElement );
114
+ for (Element soapActionChild : soapActionChildren ) {
115
+ if ("bean" .equals (soapActionChild .getLocalName ())) {
116
+ RootBeanDefinition smartInterceptorDef =
117
+ createSmartInterceptorDefinition (SoapActionSmartEndpointInterceptor .class , childElement ,
118
+ parserContext );
119
+ BeanDefinitionHolder interceptorDef =
120
+ createInterceptorDefinition (parserContext , soapActionChild );
121
+
122
+ String soapAction = childElement .getAttribute ("value" );
123
+
124
+ smartInterceptorDef .getConstructorArgumentValues ().addIndexedArgumentValue (0 , interceptorDef );
125
+ smartInterceptorDef .getConstructorArgumentValues ().addIndexedArgumentValue (1 , soapAction );
126
+
127
+ registerSmartInterceptor (parserContext , smartInterceptorDef );
128
+ }
129
+ else if ("ref" .equals (soapActionChild .getLocalName ())) {
130
+ RootBeanDefinition smartInterceptorDef =
131
+ createSmartInterceptorDefinition (SoapActionSmartEndpointInterceptor .class , childElement ,
132
+ parserContext );
133
+ BeanReference interceptorRef = createInterceptorReference (parserContext , soapActionChild );
134
+
135
+ String soapAction = childElement .getAttribute ("value" );
136
+
137
+ smartInterceptorDef .getConstructorArgumentValues ().addIndexedArgumentValue (0 , interceptorRef );
138
+ smartInterceptorDef .getConstructorArgumentValues ().addIndexedArgumentValue (1 , soapAction );
139
+
140
+ registerSmartInterceptor (parserContext , smartInterceptorDef );
141
+ }
144
142
}
145
143
}
146
144
}
@@ -150,17 +148,13 @@ else if ("soapAction".equals(childElement.getLocalName())) {
150
148
}
151
149
152
150
private void registerSmartInterceptor (ParserContext parserContext , RootBeanDefinition smartInterceptorDef ) {
153
- String mappedInterceptorName =
154
- parserContext .getReaderContext ().registerWithGeneratedName (smartInterceptorDef );
155
- parserContext
156
- .registerComponent (new BeanComponentDefinition (smartInterceptorDef , mappedInterceptorName ));
151
+ String mappedInterceptorName = parserContext .getReaderContext ().registerWithGeneratedName (smartInterceptorDef );
152
+ parserContext .registerComponent (new BeanComponentDefinition (smartInterceptorDef , mappedInterceptorName ));
157
153
}
158
154
159
155
private BeanDefinitionHolder createInterceptorDefinition (ParserContext parserContext , Element element ) {
160
- BeanDefinitionHolder interceptorDef =
161
- parserContext .getDelegate ().parseBeanDefinitionElement (element );
162
- interceptorDef =
163
- parserContext .getDelegate ().decorateBeanDefinitionIfRequired (element , interceptorDef );
156
+ BeanDefinitionHolder interceptorDef = parserContext .getDelegate ().parseBeanDefinitionElement (element );
157
+ interceptorDef = parserContext .getDelegate ().decorateBeanDefinitionIfRequired (element , interceptorDef );
164
158
return interceptorDef ;
165
159
}
166
160
0 commit comments