Source Code Cross Referenced for TechStackEntity.java in  » Code-Analyzer » hammurapi-3.20.0.3 » org » hammurapi » inspectors » metrics » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Code Analyzer » hammurapi 3.20.0.3 » org.hammurapi.inspectors.metrics 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


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 25, 2004
024:         *
025:         */
026:        package org.hammurapi.inspectors.metrics;
027:
028:        import java.util.Vector;
029:
030:        import org.apache.xpath.CachedXPathAPI;
031:        import org.apache.xpath.XPathAPI;
032:        import org.hammurapi.HammurapiException;
033:        import org.w3c.dom.Document;
034:        import org.w3c.dom.Element;
035:        import org.w3c.dom.Node;
036:        import org.w3c.dom.traversal.NodeIterator;
037:
038:        /**
039:         * @author Johannes Bellert
040:         *
041:         */
042:        public class TechStackEntity {
043:
044:            private String name = "";
045:            private String rating = "<undefined>";
046:            private String complexity = "";
047:            private String homeUrl = "NA";
048:
049:            public boolean markIfPartOfJarFileList(String jarName) {
050:                boolean ret = false;
051:                int i = 0;
052:                while (!ret && i < getJarFileList().size()) {
053:                    JarFile jf = (JarFile) getJarFileList().elementAt(i);
054:                    System.out.println(jarName + " <> " + jf.getName());
055:                    if (jarName.equals(jf.getName())) {
056:                        jf.setIsUsed(true);
057:                        ret = true;
058:                    }
059:                    i++;
060:                }
061:                return ret;
062:            }
063:
064:            /**
065:             * @return Returns the jarFileList.
066:             */
067:            public Vector getJarFileList() {
068:                return jarFileList;
069:            }
070:
071:            /**
072:             * @param jarFileList The jarFileList to set.
073:             */
074:            public void setJarFileList(Vector jarFileList) {
075:                this .jarFileList = jarFileList;
076:            }
077:
078:            /**
079:             * @return Returns the licenseList.
080:             */
081:            public Vector getLicenseList() {
082:                return licenseList;
083:            }
084:
085:            /**
086:             * @param licenseList The licenseList to set.
087:             */
088:            public void setLicenseList(Vector licenseList) {
089:                this .licenseList = licenseList;
090:            }
091:
092:            private Vector licenseList = new Vector();
093:            private Vector jarFileList = new Vector();
094:            private Vector variableMapping = new Vector();
095:            private Vector extensionMapping = new Vector();
096:
097:            /**
098:             * @return Returns the extensionMapping.
099:             */
100:            public Vector getExtensionMapping() {
101:                return extensionMapping;
102:            }
103:
104:            /**
105:             * @param extensionMapping The extensionMapping to set.
106:             */
107:            public void setExtensionMapping(Vector extensionMapping) {
108:                this .extensionMapping = extensionMapping;
109:            }
110:
111:            /**
112:             * @return Returns the variableMapping.
113:             */
114:            public Vector getVariableMapping() {
115:                return variableMapping;
116:            }
117:
118:            /**
119:             * @param variableMapping The variableMapping to set.
120:             */
121:            public void setVariableMapping(Vector variableMapping) {
122:                this .variableMapping = variableMapping;
123:            }
124:
125:            public TechStackEntity(Element holder) throws HammurapiException {
126:                super ();
127:                try {
128:                    CachedXPathAPI cxpa = new CachedXPathAPI();
129:
130:                    name = holder.getAttribute("name");
131:
132:                    rating = holder.getAttribute("rating");
133:                    complexity = holder.getAttribute("complexity");
134:
135:                    NodeIterator itvmNode = XPathAPI.selectNodeIterator(holder,
136:                            "VariableMapping");
137:                    Node vmNode;
138:                    while ((vmNode = itvmNode.nextNode()) != null) {
139:                        if (vmNode instanceof  Element) {
140:                            //System.out.println( " vmNode.getAttribute(name)"  + ((Element)vmNode).getAttribute("name") );
141:                            this .variableMapping
142:                                    .add((String) ((Element) vmNode)
143:                                            .getAttribute("name"));
144:                        }
145:                    }
146:                    NodeIterator itxmNode = XPathAPI.selectNodeIterator(holder,
147:                            "ExtensionMapping");
148:                    Node xmNode;
149:                    while ((xmNode = itxmNode.nextNode()) != null) {
150:                        if (xmNode instanceof  Element) {
151:                            // System.out.println( " xmNode.getAttribute(name)"  + ((Element)xmNode).getAttribute("name") );
152:                            this .extensionMapping
153:                                    .add((String) ((Element) xmNode)
154:                                            .getAttribute("name"));
155:                        }
156:                    }
157:
158:                    NodeIterator itLicNode = XPathAPI.selectNodeIterator(
159:                            holder, "License");
160:                    Node licNode;
161:                    while ((licNode = itLicNode.nextNode()) != null) {
162:                        if (licNode instanceof  Element) {
163:                            this .licenseList.add((String) ((Element) licNode)
164:                                    .getAttribute("name"));
165:                        }
166:                    }
167:                    NodeIterator itJarNode = XPathAPI.selectNodeIterator(
168:                            holder, "JarFile");
169:                    Node jarNode;
170:                    while ((jarNode = itJarNode.nextNode()) != null) {
171:                        if (jarNode instanceof  Element) {
172:                            this .jarFileList
173:                                    .add(new JarFile((Element) jarNode));
174:                        }
175:                    }
176:                    NodeIterator itHome = XPathAPI.selectNodeIterator(holder,
177:                            "Home");
178:                    Node homeNode;
179:                    while ((homeNode = itHome.nextNode()) != null) {
180:                        if (homeNode instanceof  Element) {
181:                            this .homeUrl = (String) ((Element) homeNode)
182:                                    .getAttribute("url");
183:                        }
184:                    }
185:                } catch (Exception e) {
186:                    throw new HammurapiException(e);
187:                }
188:            }
189:
190:            public String toString() {
191:                return name;
192:            }
193:
194:            /**
195:             * @return Returns the complexity.
196:             */
197:            public String getComplexity() {
198:                return complexity;
199:            }
200:
201:            /**
202:             * @param complexity The complexity to set.
203:             */
204:            public void setComplexity(String complexity) {
205:                this .complexity = complexity;
206:            }
207:
208:            /**
209:             * @return Returns the name.
210:             */
211:            public String getName() {
212:                return name;
213:            }
214:
215:            /**
216:             * @param name The name to set.
217:             */
218:            public void setName(String name) {
219:                this .name = name;
220:            }
221:
222:            /**
223:             * @return Returns the rating.
224:             */
225:            public String getRating() {
226:                return rating;
227:            }
228:
229:            /**
230:             * @param rating The rating to set.
231:             */
232:            public void setRating(String rating) {
233:                this .rating = rating;
234:            }
235:
236:            public TechStackEntity(String _name, String _rating) {
237:                super ();
238:                name = _name;
239:                rating = _rating;
240:
241:            }
242:
243:            public Element toDom(Document document) {
244:
245:                Element ret = document.createElement("TechStackEntity");
246:                ret.setAttribute("name", this .name);
247:
248:                ret.setAttribute("complexity", this .complexity);
249:                ret.setAttribute("rating", this .rating);
250:
251:                for (int i = 0; i < licenseList.size(); i++) {
252:                    Element retA = document.createElement("License");
253:                    retA.setAttribute("name", (String) this .licenseList
254:                            .elementAt(i));
255:                    ret.appendChild(retA);
256:                }
257:
258:                for (int i = 0; i < jarFileList.size(); i++) {
259:                    ret.appendChild(((JarFile) jarFileList.elementAt(i))
260:                            .toDom(document));
261:                }
262:                Element retURL = document.createElement("Home");
263:                retURL.setAttribute("url", this.homeUrl);
264:                ret.appendChild(retURL);
265:                return ret;
266:            }
267:
268:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.