public static Method findNewInstance(Class iface) { Method m = findInterfaceMethod(iface); if (!m.getName().equals("newInstance")) { throw new IllegalArgumentException(iface + " missing newInstance method"); } return m; }
public static Method findNewInstance(Class iface) { Method m = findInterfaceMethod(iface); if (!m.getName().equals("newInstance")) { throw new IllegalArgumentException(iface + " missing newInstance method"); } return m; }
public void generateClass(ClassVisitor v) throws NoSuchMethodException { Method proxy = ReflectUtils.findInterfaceMethod(iface); final Method method = targetClass.getMethod(methodName, proxy.getParameterTypes()); if (!proxy.getReturnType().isAssignableFrom(method.getReturnType())) {
public void generateClass(ClassVisitor cv) { final MethodInfo method = ReflectUtils.getMethodInfo(ReflectUtils.findInterfaceMethod(iface)); ClassEmitter ce = new ClassEmitter(cv); ce.begin_class(Constants.V1_2, Constants.ACC_PUBLIC, getClassName(), MULTICAST_DELEGATE, new Type[]{ Type.getType(iface) }, Constants.SOURCE_FILE); EmitUtils.null_constructor(ce); // generate proxied method emitProxy(ce, method); // newInstance CodeEmitter e = ce.begin_method(Constants.ACC_PUBLIC, NEW_INSTANCE, null); e.new_instance_this(); e.dup(); e.invoke_constructor_this(); e.return_value(); e.end_method(); // add e = ce.begin_method(Constants.ACC_PUBLIC, ADD_DELEGATE, null); e.load_this(); e.load_arg(0); e.checkcast(Type.getType(iface)); e.invoke_virtual_this(ADD_HELPER); e.return_value(); e.end_method(); ce.end_class(); }
public void generateClass(ClassVisitor v) throws NoSuchMethodException { Method proxy = ReflectUtils.findInterfaceMethod(iface); final Method method = targetClass.getMethod(methodName, proxy.getParameterTypes()); if (!proxy.getReturnType().isAssignableFrom(method.getReturnType())) {
public void generateClass(ClassVisitor cv) { final MethodInfo method = ReflectUtils.getMethodInfo(ReflectUtils.findInterfaceMethod(iface)); ClassEmitter ce = new ClassEmitter(cv); ce.begin_class(Constants.V1_2, Constants.ACC_PUBLIC, getClassName(), MULTICAST_DELEGATE, new Type[]{ Type.getType(iface) }, Constants.SOURCE_FILE); EmitUtils.null_constructor(ce); // generate proxied method emitProxy(ce, method); // newInstance CodeEmitter e = ce.begin_method(Constants.ACC_PUBLIC, NEW_INSTANCE, null); e.new_instance_this(); e.dup(); e.invoke_constructor_this(); e.return_value(); e.end_method(); // add e = ce.begin_method(Constants.ACC_PUBLIC, ADD_DELEGATE, null); e.load_this(); e.load_arg(0); e.checkcast(Type.getType(iface)); e.invoke_virtual_this(ADD_HELPER); e.return_value(); e.end_method(); ce.end_class(); }
public static Method findNewInstance(Class iface) { Method m = findInterfaceMethod(iface); if (!m.getName().equals("newInstance")) { throw new IllegalArgumentException(iface + " missing newInstance method"); } return m; }
public static Method findNewInstance(Class iface) { Method m = findInterfaceMethod(iface); if (!m.getName().equals("newInstance")) { throw new IllegalArgumentException(iface + " missing newInstance method"); } return m; }
public static Method findNewInstance(Class iface) { Method m = findInterfaceMethod(iface); if (!m.getName().equals("newInstance")) { throw new IllegalArgumentException(iface + " missing newInstance method"); } return m; }
public void generateClass(ClassVisitor v) throws NoSuchMethodException { Method proxy = ReflectUtils.findInterfaceMethod(iface); final Method method = targetClass.getMethod(methodName, proxy.getParameterTypes()); if (!proxy.getReturnType().isAssignableFrom(method.getReturnType())) {
public void generateClass(ClassVisitor v) throws NoSuchMethodException { Method proxy = ReflectUtils.findInterfaceMethod(iface); final Method method = targetClass.getMethod(methodName, proxy.getParameterTypes()); if (!proxy.getReturnType().isAssignableFrom(method.getReturnType())) {
public void generateClass(ClassVisitor v) throws NoSuchMethodException { Method proxy = ReflectUtils.findInterfaceMethod(iface); final Method method = targetClass.getMethod(methodName, proxy.getParameterTypes()); if (!proxy.getReturnType().isAssignableFrom(method.getReturnType())) {
public void generateClass(ClassVisitor cv) { final MethodInfo method = ReflectUtils.getMethodInfo(ReflectUtils.findInterfaceMethod(iface)); ClassEmitter ce = new ClassEmitter(cv); ce.begin_class(Constants.V1_2, Constants.ACC_PUBLIC, getClassName(), MULTICAST_DELEGATE, new Type[]{ Type.getType(iface) }, Constants.SOURCE_FILE); EmitUtils.null_constructor(ce); // generate proxied method emitProxy(ce, method); // newInstance CodeEmitter e = ce.begin_method(Constants.ACC_PUBLIC, NEW_INSTANCE, null); e.new_instance_this(); e.dup(); e.invoke_constructor_this(); e.return_value(); e.end_method(); // add e = ce.begin_method(Constants.ACC_PUBLIC, ADD_DELEGATE, null); e.load_this(); e.load_arg(0); e.checkcast(Type.getType(iface)); e.invoke_virtual_this(ADD_HELPER); e.return_value(); e.end_method(); ce.end_class(); }
public void generateClass(ClassVisitor cv) { final MethodInfo method = ReflectUtils.getMethodInfo(ReflectUtils.findInterfaceMethod(iface)); ClassEmitter ce = new ClassEmitter(cv); ce.begin_class(Constants.V1_2, Constants.ACC_PUBLIC, getClassName(), MULTICAST_DELEGATE, new Type[]{ Type.getType(iface) }, Constants.SOURCE_FILE); EmitUtils.null_constructor(ce); // generate proxied method emitProxy(ce, method); // newInstance CodeEmitter e = ce.begin_method(Constants.ACC_PUBLIC, NEW_INSTANCE, null); e.new_instance_this(); e.dup(); e.invoke_constructor_this(); e.return_value(); e.end_method(); // add e = ce.begin_method(Constants.ACC_PUBLIC, ADD_DELEGATE, null); e.load_this(); e.load_arg(0); e.checkcast(Type.getType(iface)); e.invoke_virtual_this(ADD_HELPER); e.return_value(); e.end_method(); ce.end_class(); }
public void generateClass(ClassVisitor cv) { final MethodInfo method = ReflectUtils.getMethodInfo(ReflectUtils.findInterfaceMethod(iface)); ClassEmitter ce = new ClassEmitter(cv); ce.begin_class(Constants.V1_2, Constants.ACC_PUBLIC, getClassName(), MULTICAST_DELEGATE, new Type[]{ Type.getType(iface) }, Constants.SOURCE_FILE); EmitUtils.null_constructor(ce); // generate proxied method emitProxy(ce, method); // newInstance CodeEmitter e = ce.begin_method(Constants.ACC_PUBLIC, NEW_INSTANCE, null); e.new_instance_this(); e.dup(); e.invoke_constructor_this(); e.return_value(); e.end_method(); // add e = ce.begin_method(Constants.ACC_PUBLIC, ADD_DELEGATE, null); e.load_this(); e.load_arg(0); e.checkcast(Type.getType(iface)); e.invoke_virtual_this(ADD_HELPER); e.return_value(); e.end_method(); ce.end_class(); }