读取xml文件类四

else if(actione.getName().equals("interceptor-ref")){
							if(null==interceptorlist){
								interceptorlist=new ArrayList<InterceptorInfo>();
							}
							String infoname=actione.attributeValue("name");
							InterceptorInfo interinfo=null;
							for(InterceptorInfo info:allinterceptor){
								if(infoname.equals(info.getInterceptorname())){
									interinfo=info;
									break;
								}
							}
							if(interinfo!=null){
								//证明没有依赖基石文件,只是依赖了本身的配置文件
								//添加拦截参数
								List<Element> paramelist=actione.elements();
								if(paramelist!=null){
									Map<String, String> parammap=new HashMap<String, String>();
									for(Element parame:paramelist){
										parammap.put(parame.attributeValue("name"), parame.getText());
									}
									interinfo.setParammap(parammap);
								}
								interceptorlist.add(interinfo);
							}else{
								//interinfo为空,需要去基石文件中的拦截器列表去找
								List<InterceptorInfo> fatherinterlist=ConstantMVC.DEFAULTMVCINFO.getAllinterceptor();
								for(InterceptorInfo info:fatherinterlist){
									if(infoname.equals(info.getInterceptorname())){
										List<Element> paramelist=actione.elements();
										if(paramelist!=null){
											Map<String, String> parammap=new HashMap<String, String>();
											for(Element parame:paramelist){
												parammap.put(parame.attributeValue("name"), parame.getText());
											}
											info.setParammap(parammap);
										}
										interceptorlist.add(info);
										break;
									}
								}
							}
						}
						action.setInterceptorlist(interceptorlist);
						action.setResultmap(resultmap);
						action.setStacklist(stacklist);
					}
					String key=action.getActionname().split("_")[0];
					actionmap.put(key, action);
				}
				mvc.setIncludefilelist(includefilelist);
				mvc.setAllinterceptor(allinterceptor);
				mvc.setStackmap(stackmap);
				mvc.setPackageobj(pack);
				mvc.setActionmap(actionmap);
			}
			if(null==ConstantMVC.BEIFENGMVCMAP){
				ConstantMVC.BEIFENGMVCMAP=new HashMap<String, BeifengMvc>();
				ConstantMVC.BEIFENGMVCMAP.put(filelocation, mvc);
			}
		} catch (DocumentException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值