01: /*
02: * Created on Dec 19, 2004
03: *
04: */
05: package org.hammurapi.inspectors.metrics;
06:
07: import java.util.Hashtable;
08: import java.util.Vector;
09:
10: import org.w3c.dom.Document;
11: import org.w3c.dom.Element;
12:
13: /**
14: * @author 111001082
15: *
16: */
17: public class JarFileList extends Vector {
18:
19: public void markUsedJarFiles(Vector techEntityList,
20: Hashtable allTechStackEntitiesTable) {
21: for (int i = 0; i < this .size(); i++) {
22: int j = 0;
23: boolean notFound = true;
24: JarFile jarFile = (JarFile) this .elementAt(i);
25: while (notFound && j < techEntityList.size()) {
26:
27: TechStackEntity tse = (TechStackEntity) techEntityList
28: .elementAt(j);
29: if (tse != null) {
30:
31: // side effect in markIfPartOfJarFileList: tse Jars isUsed flag will be set
32: if (tse.markIfPartOfJarFileList(jarFile
33: .getJarNameWithoutPath())) {
34: jarFile.setIsUsed(true);
35: // System.out.println( "TRUE " + jarFile);
36: }
37: }
38: j++;
39: }
40: }
41: }
42:
43: public Element toDom(Document document) {
44:
45: Element jarFileListE = document
46: .createElement("ClasspathFileLicense");
47:
48: for (int i = 0; i < this .size(); i++) {
49: int j = 0;
50: boolean notFound = true;
51: JarFile jarFile = (JarFile) this .elementAt(i);
52: jarFileListE.appendChild(jarFile.toDom(document));
53: //System.out.println( jarFile.toString());
54: }
55: return jarFileListE;
56: }
57: }
|