1 32 33 package com.jeantessier.classreader; 34 35 import java.io.*; 36 import java.util.*; 37 38 45 public abstract class ClassfileLoader { 46 public abstract Classfile getClassfile(String name); 48 public abstract Collection getAllClassfiles(); 49 public abstract Collection getAllClassNames(); 50 51 public void load(Collection filenames) { 52 fireBeginSession(); 53 54 Iterator i = filenames.iterator(); 55 while (i.hasNext()) { 56 load(i.next().toString()); 57 } 58 59 fireEndSession(); 60 } 61 62 protected abstract void load(String filename); 64 protected abstract void load(String filename, InputStream in); 65 protected abstract Classfile load(DataInputStream in) throws IOException; 66 67 public abstract void addLoadListener(LoadListener listener); 69 public abstract void removeLoadListener(LoadListener listener); 70 protected abstract void fireBeginSession(); 71 protected abstract void fireBeginGroup(String group_name, int size); 72 protected abstract void fireBeginClassfile(String filename); 73 protected abstract void fireBeginFile(String filename); 74 protected abstract void fireEndClassfile(String filename, Classfile classfile); 75 protected abstract void fireEndFile(String filename); 76 protected abstract void fireEndGroup(String group_name); 77 protected abstract void fireEndSession(); 78 } 79 | Popular Tags |