1 55 package org.jboss.axis.wsdl.toJava; 56 57 import java.util.ArrayList ; 58 import java.util.Iterator ; 59 import java.util.List ; 60 61 67 public class GeneratedFileInfo 68 { 69 70 protected ArrayList list = new ArrayList (); 71 72 86 public class Entry 87 { 88 public String fileName; 90 public String className; 92 public String type; 94 95 public Entry(String name, String className, String type) 96 { 97 this.fileName = name; 98 this.className = className; 99 this.type = type; 100 } 101 102 public String toString() 103 { 104 return "Name: " + fileName + 105 " Class: " + className + 106 " Type: " + type; 107 } 108 109 110 } 112 113 116 public GeneratedFileInfo() 117 { 118 } 119 120 123 public List getList() 124 { 125 return list; 126 } 127 128 131 public void add(String name, String className, String type) 132 { 133 list.add(new Entry(name, className, type)); 134 } 135 136 146 public List findType(String type) 147 { 148 ArrayList ret = null; 150 for (Iterator i = list.iterator(); i.hasNext();) 151 { 152 Entry e = (Entry)i.next(); 153 if (e.type.equals(type)) 154 { 155 if (ret == null) 156 ret = new ArrayList (); 157 ret.add(e); 158 } 159 } 160 return ret; 161 } 162 163 169 public Entry findName(String fileName) 170 { 171 for (Iterator i = list.iterator(); i.hasNext();) 173 { 174 Entry e = (Entry)i.next(); 175 if (e.fileName.equals(fileName)) 176 { 177 return e; 178 } 179 } 180 return null; 181 } 182 183 189 public Entry findClass(String className) 190 { 191 for (Iterator i = list.iterator(); i.hasNext();) 193 { 194 Entry e = (Entry)i.next(); 195 if (e.className.equals(className)) 196 { 197 return e; 198 } 199 } 200 return null; 201 } 202 203 206 public List getClassNames() 207 { 208 ArrayList ret = new ArrayList (list.size()); 210 for (Iterator i = list.iterator(); i.hasNext();) 211 { 212 Entry e = (Entry)i.next(); 213 ret.add(e.className); 214 } 215 return ret; 216 } 217 218 221 public List getFileNames() 222 { 223 ArrayList ret = new ArrayList (list.size()); 225 for (Iterator i = list.iterator(); i.hasNext();) 226 { 227 Entry e = (Entry)i.next(); 228 ret.add(e.fileName); 229 } 230 return ret; 231 } 232 233 236 public String toString() 237 { 238 String s = ""; 239 for (Iterator i = list.iterator(); i.hasNext();) 240 { 241 Entry entry = (Entry)i.next(); 242 s += entry.toString() + "\n"; 243 } 244 return s; 245 } 246 } 247 | Popular Tags |