01: /*
02: * Hammurapi
03: * Automated Java code review system.
04: * Copyright (C) 2004 Johannes Bellert
05: *
06: * This program is free software; you can redistribute it and/or modify
07: * it under the terms of the GNU General Public License as published by
08: * the Free Software Foundation; either version 2 of the License, or
09: * (at your option) any later version.
10: *
11: * This program is distributed in the hope that it will be useful,
12: * but WITHOUT ANY WARRANTY; without even the implied warranty of
13: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14: * GNU General Public License for more details.
15: *
16: * You should have received a copy of the GNU General Public License
17: * along with this program; if not, write to the Free Software
18: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19: *
20: * URL: http://www.hammurapi.com
21: * e-Mail: Johannes.Bellert@ercgroup.com
22: *
23: * * Created on Apr 19, 2004
24: *
25: */
26: package org.hammurapi.inspectors.metrics;
27:
28: import java.util.Enumeration;
29: import java.util.Properties;
30:
31: import org.w3c.dom.Document;
32: import org.w3c.dom.Element;
33:
34: /**
35: * @author Johannes Bellert
36: *
37: */
38: public class ArchitecturalLayerExtensionsMap extends Properties
39: implements ArchitecturalLayerConstants {
40:
41: //!! job: use XML based configuration in next Gen
42: /*
43: {
44:
45: this.put( "org.apache.struts.action.Action", STRUTS_MVC);
46: this.put( "org.apache.struts.action.ActionForm", STRUTS_FORM);
47: this.put( "net.sf.navigator.displayer.MessageResourcesMenuDisplayer", STRUTS_MENU);
48: this.put( "org.apache.struts.action.PlugIn", STRUTS_PLUGIN);
49: this.put( "org.apache.log4j.Logger", LOGGER_LOG4J);
50: this.put( "junit.framework.Test", JUNIT_TEST);
51: this.put( "junit.framework.TestCase", JUNIT_TEST);
52: // this.put( "org.apache.jsp.HttpJspBase", JSP);
53: this.put( "org.apache.jasper.runtime.HttpJspBase", JSP);
54: this.put( "javax.servlet.http.HttpServlet", HTTPSERVLET);
55:
56:
57: this.put( "javax.ejb.EJBObject", EJB);
58: this.put( "javax.ejb.EJBHome", EJB);
59: this.put( "javax.ejb.SessionBean", EJB_SESSIONBEAN);
60: this.put( "javax.ejb.SessionContext", EJB_SESSIONBEAN);
61: this.put( "javax.ejb.EntityBean", EJB_ENTITYBEAN);
62: this.put( "javax.ejb.EntityContext", EJB_ENTITYBEAN);
63:
64: this.put( "org.quartz.StatefulJob", QUARTZ);
65: this.put( "org.quartz.xml.JobSchedulingDataProcessor", QUARTZ);
66:
67: this.put( "java.lang.Exception", EXCEPTION);
68:
69: this.put( "org.apache.jasper.runtime.HttpJspBase", JSP);
70: // implements org.apache.jasper.runtime.JspSourceDependent
71:
72: }
73:
74:
75: */
76: public Element toDom(Document document){
77:
78: Element ret=document.createElement("ExtensionMappings");
79: ret.setAttribute("size", String.valueOf(this.size()));
80: Enumeration enum = this.keys();
81: while (enum.hasMoreElements()) {
82: String key = (String) enum.nextElement();
83: Element layer=document.createElement("Mapping");
84: String cat = (String)get(key);
85: layer.setAttribute("identificator", key );
86: layer.setAttribute("category", cat );
87: ret.appendChild(layer);
88: }
89: return ret;
90:
91: }
92: }
|