1 32 33 package com.jeantessier.classreader; 34 35 import java.io.*; 36 import java.util.*; 37 38 public abstract class ClassfileLoaderDecorator extends ClassfileLoader { 39 private ClassfileLoader loader; 40 41 public ClassfileLoaderDecorator(ClassfileLoader loader) { 42 this.loader = loader; 43 } 44 45 protected ClassfileLoader getLoader() { 46 return loader; 47 } 48 49 public Classfile getClassfile(String name) { 50 return getLoader().getClassfile(name); 51 } 52 53 public Collection getAllClassfiles() { 54 return getLoader().getAllClassfiles(); 55 } 56 57 public Collection getAllClassNames() { 58 return getLoader().getAllClassNames(); 59 } 60 61 public void addLoadListener(LoadListener listener) { 62 getLoader().addLoadListener(listener); 63 } 64 65 public void removeLoadListener(LoadListener listener) { 66 getLoader().removeLoadListener(listener); 67 } 68 69 protected void fireBeginSession() { 70 getLoader().fireBeginSession(); 71 } 72 73 protected void fireBeginGroup(String groupName, int size) { 74 getLoader().fireBeginGroup(groupName, size); 75 } 76 77 protected void fireBeginFile(String filename) { 78 getLoader().fireBeginFile(filename); 79 } 80 81 protected void fireBeginClassfile(String filename) { 82 getLoader().fireBeginClassfile(filename); 83 } 84 85 protected void fireEndClassfile(String filename, Classfile classfile) { 86 getLoader().fireEndClassfile(filename, classfile); 87 } 88 89 protected void fireEndFile(String filename) { 90 getLoader().fireEndFile(filename); 91 } 92 93 protected void fireEndGroup(String groupName) { 94 getLoader().fireEndGroup(groupName); 95 } 96 97 protected void fireEndSession() { 98 getLoader().fireEndSession(); 99 } 100 101 protected Classfile load(DataInputStream in) throws IOException { 102 return getLoader().load(in); 103 } 104 } 105 | Popular Tags |