001: /*
002: * Hammurapi
003: * Automated Java code review system.
004: * Copyright (C) 2004 Johannes Bellert
005: *
006: * This program is free software; you can redistribute it and/or modify
007: * it under the terms of the GNU General Public License as published by
008: * the Free Software Foundation; either version 2 of the License, or
009: * (at your option) any later version.
010: *
011: * This program is distributed in the hope that it will be useful,
012: * but WITHOUT ANY WARRANTY; without even the implied warranty of
013: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
014: * GNU General Public License for more details.
015: *
016: * You should have received a copy of the GNU General Public License
017: * along with this program; if not, write to the Free Software
018: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
019: *
020: * URL: http://www.hammurapi.com
021: * e-Mail: Johannes.Bellert@ercgroup.com
022: *
023: * * Created on Apr 26, 2004
024: *
025: */
026: package org.hammurapi.inspectors.metrics;
027:
028: import java.util.Hashtable;
029: import java.util.Vector;
030:
031: /**
032: * @author Johannes Bellert
033: *
034: */
035: public class ArchitecturalVariableMapping implements
036: ArchitecturalLayerConstants {
037: private Hashtable mappings = new Hashtable();
038:
039: {
040: String[] str1 = { "org.apache.commons.logging.Log",
041: "org.apache.log4j.Level",
042: "org.apache.commons.logging.LogFactory",
043: "org.apache.log4j.Logger", "org.apache.log4j.*" };
044: put(LOGGING, str1);
045:
046: String[] str2 = { "org.apache.log4j.Category" };
047: put(LOGGING_DEPRECIATED, str2);
048:
049: String[] str3 = { "java.net.URL", "java.net.*" };
050: put(NETWORK, str3);
051:
052: String[] str4 = { "javax.naming.*" };
053: put(JNDI, str4);
054:
055: String[] str5 = { "javax.rmi.*" };
056: put(RMI, str5);
057:
058: String[] str6 = { "javax.jms.*" };
059: put(JMS, str6);
060:
061: String[] str7 = { "org.apache.commons.dbutils.*",
062: "org.apache.commons.dbutils.handlers.*" };
063: put(JAKARTA_DBUTIL, str7);
064:
065: String[] str71 = { "org.apache.commons.beanutils.*" };
066: put(JAKARTA_BEANUTIL, str71);
067:
068: String[] str72 = { "org.apache.commons.digester.*" };
069: put(JAKARTA_DIGESTER, str72);
070:
071: String[] str8 = { "com.gecapital.erc.FileNet.FileNetProxy" };
072: put(FILENET_ERC_PROXY, str8);
073:
074: String[] str9 = { "com.tibco.tibrv.*" };
075: put(TIB_CORE, str9);
076:
077: String[] str10 = { "com.tibco.inconcert.*",
078: "com.inconcert.icjava.*" };
079: put(TIB_INCONCERT, str10);
080:
081: String[] str10_1 = { "com.inconcert.xml.sax.IcWebStateBean",
082: "com.inconcert.xml.sax.IcWebStateBean",
083: "com.inconcert.xml.sax.*" };
084: put(TIB_INCONCERT_WEB, str10_1);
085:
086: String[] str11 = { "org.quartz.CronTrigger",
087: "org.quartz.Trigger", "org.quartz.Scheduler",
088: "org.quartz.TriggerListener",
089: "org.quartz.JobExecutionContext" };
090: put(QUARTZ, str11);
091:
092: String[] str12 = { "javax.mail.internet.InternetAddress",
093: "javax.mail.internet.MimeBodyPart",
094: "javax.mail.internet.MimeMessage",
095: "javax.mail.internet.MimeMultipart",
096: "javax.mail.Message", "javax.mail.Multipart",
097: "javax.mail.Session", "javax.mail.Transport",
098: "javax.mail.internet.*",
099: "javax.mail.MessagingException",
100: "javax.mail.SendFailedException",
101: "javax.mail.Authenticator", "javax.mail.*" };
102: put(MAIL, str12);
103:
104: String[] str13 = { "javax.activation.DataHandler",
105: "javax.activation.FileDataSource",
106: "javax.activation.DataSource", "javax.activation.*" };
107: put(ACTIVATION_FRAMEWORK, str13);
108:
109: String[] str14 = { "javax.transaction.UserTransaction",
110: "javax.transaction.*" };
111: put(JTA, str14);
112:
113: String[] str15 = { "java.sql.Statement", "java.sql.Connection",
114: "java.sql.ResultSet" };
115: put(SQL_COMMON, str15);
116:
117: String[] str16 = { "java.sql.ResultSetMetaData" };
118: put(SQL_DEPRECIATED, str16);
119:
120: String[] str17 = { "javax.sql.DataSource" };
121: ;
122: put(SQL_DATASOURCE, str17);
123:
124: String[] str19 = { "java.sql.PreparedStatement" };
125: put(SQL_PREPARED, str19);
126:
127: //!! shall be differentiated: Java vs. Oracle
128: String[] str20 = { "java.sql.Blob", "java.sql.Clob",
129: "oracle.sql.BLOB", "oracle.sql.CLOB" };
130: put(SQL_LOB, str20);
131:
132: String[] str21 = {
133: "oracle.jdbc.driver.OracleCallableStatement",
134: "oracle.sql.ARRAY", "oracle.sql.ArrayDescriptor",
135: "oracle.sql.STRUCT", "oracle.sql.StructDescriptor" };
136: put(PL_SQL, str21);
137:
138: String[] str22 = { "org.w3c.dom.Document",
139: "org.w3c.dom.Element", "org.w3c.dom.Node",
140: "org.w3c.dom.NodeList", "org.w3c.dom.*" };
141: put(XML_W3C_DOM, str22);
142:
143: String[] str222 = { "org.xml.sax.*", "org.w3c.dom.Element",
144: "org.w3c.dom.Node", "org.w3c.dom.NodeList" };
145: put(XML_SAX, str222);
146:
147: String[] str223 = { "javax.xml.parsers.*" };
148: put(XML_PARSER, str223);
149:
150: String[] str23 = { "java.io.File", "java.io.FileWriter",
151: "java.io.FileReader", "java.io.FileInputStream",
152: "java.io.FileInputStream", "java.io.OutputStream",
153: "java.io.InputStream" };
154: put(IO_FILE, str23);
155:
156: String[] str24 = { "java.util.PropertyResourceBundle",
157: "java.util.ResourceBundle", "java.util.Property" };
158: put(FILE_PROPERTY, str24);
159:
160: String[] str25 = {
161: "net.sf.navigator.menu.MenuComponent",
162: "net.sf.navigator.displayer.MenuDisplayerMapping",
163: "net.sf.navigator.displayer.MessageResourcesMenuDisplayer",
164: "net.sf.navigator.*" };
165: put(STRUTS_MENU, str25);
166:
167: String[] str26 = { "org.apache.struts.action.ActionMapping",
168: "org.apache.struts.action.ActionError",
169: "org.apache.struts.action.ActionErrors",
170: "org.apache.struts.util.MessageResources",
171: "org.apache.struts.action.ActionServlet",
172: "org.apache.struts.action.ActionMessage",
173: "org.apache.struts.action.ActionMessages",
174: "org.apache.struts.action.ActionForward",
175: "org.apache.struts.action.*",
176: "org.apache.struts.config.*" };
177: put(STRUTS_MVC, str26);
178:
179: String[] str26_1 = { "org.apache.struts.action.ActionForm",
180: "org.apache.struts.action.DynaActionForm" };
181: put(STRUTS_FORM, str26_1);
182:
183: String[] str26_2 = { "org.apache.struts.upload.FormFile" };
184: put(STRUTS_UPLOAD, str26_2);
185:
186: String[] str26_3 = { "org.apache.velocity.*" };
187: put(VELOCITY, str26_3);
188:
189: String[] str27 = { "javax.servlet.http.HttpServletRequest",
190: "javax.servlet.http.HttpServletResponse",
191: "javax.servlet.http.HttpSession",
192: "javax.servlet.http.*", "javax.servlet.jsp.JspFactory",
193: "javax.servlet.jsp.JspWriter",
194: "javax.servlet.jsp.PageContext" };
195: put(JSP, str27);
196:
197: String[] str271 = { "javax.servlet.ServletContext",
198: "javax.servlet.ServletConfig",
199: "javax.servlet.ServletOutputStream", "javax.servlet.*" };
200: put(SERVLET, str271);
201:
202: String[] str28 = { "net.sf.hibernate.Session",
203: "net.sf.hibernate.SessionFactory",
204: "net.sf.hibernate.cfg.Configuration",
205: "net.sf.hibernate.Transaction",
206: "net.sf.hibernate.type.Type[]",
207: "net.sf.hibernate.HibernateException",
208: "net.sf.hibernate.SessionFactory" };
209: put(HIBERNATE, str28);
210:
211: String[] str29 = { "org.exolab.castor.xml.Unmarshaller",
212: "org.exolab.castor.mapping.Mapping",
213: "org.exolab.castor.xml.Marshaller" };
214: put(CASTOR, str29);
215:
216: String[] str30 = { "junit.framework.TestSuite" };
217: put(JUNIT_TEST, str30);
218:
219: String[] str31 = {
220: "org.springframework.transaction.PlatformTransactionManager",
221: "org.springframework.transaction.support.TransactionTemplate",
222: "org.springframework.transaction.TransactionStatus",
223: "org.springframework.web.context.WebApplicationContext",
224: "org.springframework.context.support.ClassPathXmlApplicationContext", };
225: put(SPRING_TX, str31);
226:
227: String[] str32 = { "com.meterware.httpunit.WebConversation",
228: "com.meterware.httpunit.WebLink[]",
229: "com.meterware.httpunit.WebForm",
230: "com.meterware.httpunit.*" };
231: put(HTTPUNIT, str32);
232:
233: String[] str33 = { "com.lowagie.*" };
234: put(PDF_GEN_ITEXT, str33);
235:
236: String[] str34 = { "javax.crypto.*" };
237: put(JCE, str34);
238:
239: String[] str35 = { "jxl.write.*", "jxl.format.*", "jxl.*" };
240: put(JXL, str35);
241:
242: String[] str36 = { "org.apache.commons.validator.*" };
243: put(APACHE_COMMONS_VALIDATOR, str36);
244:
245: String[] str37 = { "javax.ejb.CreateException",
246: "javax.ejb.EJBHome", "javax.ejb.EJBObject",
247: "javax.ejb.Handle", "javax.ejb.*" };
248: put(EJB, str37);
249:
250: String[] str38 = { "javax.net.ssl.SSLSocket",
251: "javax.net.ssl.*", "com.sun.net.ssl.*" };
252: put(SSL, str38);
253:
254: String[] str39 = { "javax.security.cert.X509Certificate",
255: "javax.security.cert.*", "com.ibm.xml.dsig.*" };
256: put(SECURITY_CERTIFICATE, str39);
257: }
258:
259: public void put(String key, String[] strArray) {
260:
261: Vector vc = new Vector();
262: for (int i = 0; i < strArray.length; i++) {
263: vc.add((String) strArray[i]);
264: }
265: this .mappings.put(key, vc);
266: }
267:
268: /**
269: * @return Returns the mappings.
270: */
271: public Hashtable getMappings() {
272: return mappings;
273: }
274:
275: /**
276: * @param mappings The mappings to set.
277: */
278: public void setMappings(Hashtable mappings) {
279: this.mappings = mappings;
280: }
281: }
|