1 16 package org.apache.axis.wsdl.toJava; 17 18 import java.util.ArrayList ; 19 import java.util.Iterator ; 20 import java.util.List ; 21 22 28 public class GeneratedFileInfo { 29 30 31 protected ArrayList list = new ArrayList (); 32 33 47 public class Entry { 48 49 51 52 public String fileName; 53 54 56 57 public String className; 58 59 61 62 public String type; 63 64 71 public Entry(String name, String className, String type) { 72 73 this.fileName = name; 74 this.className = className; 75 this.type = type; 76 } 77 78 83 public String toString() { 84 return "Name: " + fileName + " Class: " + className + " Type: " 85 + type; 86 } 87 } 89 92 public GeneratedFileInfo() { 93 } 94 95 100 public List getList() { 101 return list; 102 } 103 104 111 public void add(String name, String className, String type) { 112 list.add(new Entry(name, className, type)); 113 } 114 115 125 public List findType(String type) { 126 127 ArrayList ret = null; 129 130 for (Iterator i = list.iterator(); i.hasNext();) { 131 Entry e = (Entry) i.next(); 132 133 if (e.type.equals(type)) { 134 if (ret == null) { 135 ret = new ArrayList (); 136 } 137 138 ret.add(e); 139 } 140 } 141 142 return ret; 143 } 144 145 152 public Entry findName(String fileName) { 153 154 for (Iterator i = list.iterator(); i.hasNext();) { 156 Entry e = (Entry) i.next(); 157 158 if (e.fileName.equals(fileName)) { 159 return e; 160 } 161 } 162 163 return null; 164 } 165 166 173 public Entry findClass(String className) { 174 175 for (Iterator i = list.iterator(); i.hasNext();) { 177 Entry e = (Entry) i.next(); 178 179 if (e.className.equals(className)) { 180 return e; 181 } 182 } 183 184 return null; 185 } 186 187 192 public List getClassNames() { 193 194 ArrayList ret = new ArrayList (list.size()); 196 197 for (Iterator i = list.iterator(); i.hasNext();) { 198 Entry e = (Entry) i.next(); 199 200 ret.add(e.className); 201 } 202 203 return ret; 204 } 205 206 211 public List getFileNames() { 212 213 ArrayList ret = new ArrayList (list.size()); 215 216 for (Iterator i = list.iterator(); i.hasNext();) { 217 Entry e = (Entry) i.next(); 218 219 ret.add(e.fileName); 220 } 221 222 return ret; 223 } 224 225 230 public String toString() { 231 232 String s = ""; 233 234 for (Iterator i = list.iterator(); i.hasNext();) { 235 Entry entry = (Entry) i.next(); 236 237 s += entry.toString() + "\n"; 238 } 239 240 return s; 241 } 242 } 243 | Popular Tags |