mirror of
https://github.com/apache/struts.git
synced 2026-08-31 19:35:40 +00:00
WW-5293 Split #buildInterceptorConfig from #loadInterceptors
This commit is contained in:
+15
-13
@@ -904,22 +904,24 @@ public abstract class XmlDocConfigurationProvider implements ConfigurationProvid
|
||||
}
|
||||
|
||||
protected void loadInterceptors(PackageConfig.Builder context, Element element) throws ConfigurationException {
|
||||
iterateChildrenByTagName(element, "interceptor", interceptorElement -> {
|
||||
String name = interceptorElement.getAttribute("name");
|
||||
String className = interceptorElement.getAttribute("class");
|
||||
|
||||
Map<String, String> params = XmlHelper.getParams(interceptorElement);
|
||||
InterceptorConfig config = new InterceptorConfig.Builder(name, className)
|
||||
.addParams(params)
|
||||
.location(DomHelper.getLocationObject(interceptorElement))
|
||||
.build();
|
||||
|
||||
context.addInterceptorConfig(config);
|
||||
});
|
||||
|
||||
iterateChildrenByTagName(
|
||||
element,
|
||||
"interceptor",
|
||||
interceptorElement -> context.addInterceptorConfig(buildInterceptorConfig(interceptorElement)));
|
||||
loadInterceptorStacks(element, context);
|
||||
}
|
||||
|
||||
protected InterceptorConfig buildInterceptorConfig(Element interceptorElement) {
|
||||
String interceptorName = interceptorElement.getAttribute("name");
|
||||
String className = interceptorElement.getAttribute("class");
|
||||
|
||||
Map<String, String> params = XmlHelper.getParams(interceptorElement);
|
||||
return new InterceptorConfig.Builder(interceptorName, className)
|
||||
.addParams(params)
|
||||
.location(DomHelper.getLocationObject(interceptorElement))
|
||||
.build();
|
||||
}
|
||||
|
||||
protected void loadInterceptorStacks(Element element, PackageConfig.Builder context) throws ConfigurationException {
|
||||
iterateChildrenByTagName(element, "interceptor-stack", interceptorStackElement -> {
|
||||
InterceptorStackConfig config = loadInterceptorStack(interceptorStackElement, context);
|
||||
|
||||
Reference in New Issue
Block a user