⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 aopinterceptorsxmlloader.java

📁 一个非常好的FRAMWRK!是一个外国组织做的!不!
💻 JAVA
字号:
	/*
	 * Copyright 2003-2005 the original author or authors.
	 * Licensed under the Apache License, Version 2.0 (the "License");
	 * you may not use this file except in compliance with the License.
	 * You may obtain a copy of the License at
	 *
	 * http://www.apache.org/licenses/LICENSE-2.0
	 *
	 * Unless required by applicable law or agreed to in writing, software
	 * distributed under the License is distributed on an "AS IS" BASIS,
	 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
	 * See the License for the specific language governing permissions and
	 * limitations under the License.
	 * 
	 */
	package com.jdon.container.config.aspect;
	
	import java.util.Iterator;
	import java.util.List;
	import java.util.Map;
	
	import org.jdom.Element;
	
import com.jdon.container.config.ComponentMetaDef;
	import com.jdon.controller.config.XmlParser;
	import com.jdon.util.Debug;
	
	/**
	 * @author <a href="mailto:banqiao@jdon.com">banq</a>
	 *
	 */
	public class AopInterceptorsXmlLoader extends XmlParser {
	    
	    public final static String module = AopInterceptorsXmlLoader.class.getName();
	
	    public void parse(Element root, Map mps) throws Exception {        
	        List interceptors = root.getChildren("interceptor");
	        Debug.logVerbose(" found interceptor size:" + interceptors.size(), module);
	        Iterator iter = interceptors.iterator();
	        
	        ComponentMetaDef componentMetaDef;
	        
	        while (iter.hasNext()) {
	          Element component = (Element) iter.next();
	          String name = component.getAttributeValue("name");
	          Debug.logVerbose(" found interceptor name:" + name, module);
	          String className = component.getAttributeValue("class");   
	          String pointcut = component.getAttributeValue("pointcut");	          
	          List mappings = component.getChildren("constructor");
	          String[] constructors = null;
	          if ((mappings != null) && (mappings.size() != 0)) {
	              constructors = new String[mappings.size()];
	              int j = 0;
	              Iterator i = mappings.iterator();
	              while (i.hasNext()) {
	                Element constructor = (Element) i.next();
	                String value = constructor.getAttributeValue("value");
	                Debug.logVerbose(" interceptor "+ name + "constructor=" + value, module);
	                constructors[j] = value;
	                j++;
	              }
	            }
	
	          if (constructors != null)
	              componentMetaDef = new AspectComponentsMetaDef(name, className, constructors, pointcut);
	          else
	              componentMetaDef = new AspectComponentsMetaDef(name, className, pointcut);
	          
	          mps.put(name, componentMetaDef);
	        }
	      }
	    
	  
	}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -