1 54 package org.logicalcobwebs.cglib.proxy; 55 56 import java.lang.reflect.Method ; 57 import java.lang.reflect.Modifier ; 58 import java.util.Iterator ; 59 import org.logicalcobwebs.cglib.core.ClassEmitter; 60 import org.logicalcobwebs.cglib.core.CodeEmitter; 61 import org.logicalcobwebs.cglib.core.ReflectUtils; 62 63 class NoOpGenerator 64 implements CallbackGenerator 65 { 66 public static final NoOpGenerator INSTANCE = new NoOpGenerator(); 67 68 public void generate(ClassEmitter ce, Context context) { 69 for (Iterator it = context.getMethods(); it.hasNext();) { 70 Method method = (Method )it.next(); 71 int access1 = method.getModifiers(); 72 int access2 = context.getModifiers(method); 73 if (Modifier.isProtected(access1) && Modifier.isPublic(access2)) { 74 CodeEmitter e = ce.begin_method(access2, 75 ReflectUtils.getSignature(method), 76 ReflectUtils.getExceptionTypes(method), 77 null); 78 e.load_this(); 79 e.load_args(); 80 e.super_invoke(); 81 e.return_value(); 82 e.end_method(); 83 } 84 } 85 } 86 87 public void generateStatic(CodeEmitter e, Context context) { } 88 } 89 | Popular Tags |