/** * Return the name of the synthetic method created by CGLIB which is * used by {@link #invokeSuper} to invoke the superclass * (non-intercepted) method implementation. The parameter types are * the same as the proxied method. */ public String getSuperName() { return sig2.getName(); }
private String getMethodField(Signature impl) { return impl.getName() + "$Method"; } private String getMethodProxyField(Signature impl) {
/** * Return the name of the synthetic method created by CGLIB which is * used by {@link #invokeSuper} to invoke the superclass * (non-intercepted) method implementation. The parameter types are * the same as the proxied method. */ public String getSuperName() { return sig2.getName(); }
private String getMethodProxyField(Signature impl) { return impl.getName() + "$Proxy"; }
private String getMethodField(Signature impl) { return impl.getName() + "$Method"; } private String getMethodProxyField(Signature impl) {
private void emit_invoke(int opcode, Type type, Signature sig) { if (sig.getName().equals(Constants.CONSTRUCTOR_NAME) && ((opcode == Constants.INVOKEVIRTUAL) || (opcode == Constants.INVOKESTATIC))) { // TODO: error } mv.visitMethodInsn(opcode, type.getInternalName(), sig.getName(), sig.getDescriptor(), opcode == Opcodes.INVOKEINTERFACE); }
private void emit_invoke(int opcode, Type type, Signature sig) { if (sig.getName().equals(Constants.CONSTRUCTOR_NAME) && ((opcode == Constants.INVOKEVIRTUAL) || (opcode == Constants.INVOKESTATIC))) { // TODO: error } mv.visitMethodInsn(opcode, type.getInternalName(), sig.getName(), sig.getDescriptor(), opcode == Opcodes.INVOKEINTERFACE); }
public Object transform(Object value) { return ((MethodInfo)value).getSignature().getName(); } });
public static boolean isConstructor(MethodInfo method) { return method.getSignature().getName().equals(Constants.CONSTRUCTOR_NAME); }
public Object transform(Object value) { return ((MethodInfo)value).getSignature().getName(); } });
public CodeEmitter begin_method(int access, Signature sig, Type[] exceptions) { final CodeEmitter emitter = super.begin_method(access, sig, exceptions); if (sig.getName().equals(Constants.CONSTRUCTOR_NAME)) { return new CodeEmitter(emitter) { public void visitInsn(int opcode) { if (opcode == Constants.RETURN) { load_this(); invoke(info); } super.visitInsn(opcode); } }; } return emitter; } }
public static boolean isConstructor(MethodInfo method) { return method.getSignature().getName().equals(Constants.CONSTRUCTOR_NAME); }
public void generateStatic(CodeEmitter e, Context context, List methods) { for (Iterator it = methods.iterator(); it.hasNext();) { MethodInfo method = (MethodInfo)it.next(); EmitUtils.load_method(e, method); e.putfield(context.getImplSignature(method).getName()); } } }
public void generateStatic(CodeEmitter e, Context context, List methods) { for (Iterator it = methods.iterator(); it.hasNext();) { MethodInfo method = (MethodInfo)it.next(); EmitUtils.load_method(e, method); e.putfield(context.getImplSignature(method).getName()); } } }
private Signature rename(Signature sig, int index) { return new Signature("CGLIB$" + sig.getName() + "$" + index, sig.getDescriptor()); }
private Signature rename(Signature sig, int index) { return new Signature("CGLIB$" + sig.getName() + "$" + index, sig.getDescriptor()); }
public void invoke(MethodInfo method, Type virtualType) { ClassInfo classInfo = method.getClassInfo(); Type type = classInfo.getType(); Signature sig = method.getSignature(); if (sig.getName().equals(Constants.CONSTRUCTOR_NAME)) { invoke_constructor(type, sig); } else if (TypeUtils.isInterface(classInfo.getModifiers())) { invoke_interface(type, sig); } else if (TypeUtils.isStatic(method.getModifiers())) { invoke_static(type, sig); } else { invoke_virtual(virtualType, sig); } }
public static void load_method(CodeEmitter e, MethodInfo method) { load_class(e, method.getClassInfo().getType()); e.push(method.getSignature().getName()); push_object(e, method.getSignature().getArgumentTypes()); e.invoke_virtual(Constants.TYPE_CLASS, GET_DECLARED_METHOD); }
public void invoke(MethodInfo method, Type virtualType) { ClassInfo classInfo = method.getClassInfo(); Type type = classInfo.getType(); Signature sig = method.getSignature(); if (sig.getName().equals(Constants.CONSTRUCTOR_NAME)) { invoke_constructor(type, sig); } else if (TypeUtils.isInterface(classInfo.getModifiers())) { invoke_interface(type, sig); } else if (TypeUtils.isStatic(method.getModifiers())) { invoke_static(type, sig); } else { invoke_virtual(virtualType, sig); } }
public static void load_method(CodeEmitter e, MethodInfo method) { load_class(e, method.getClassInfo().getType()); e.push(method.getSignature().getName()); push_object(e, method.getSignature().getArgumentTypes()); e.invoke_virtual(Constants.TYPE_CLASS, GET_DECLARED_METHOD); }