/** Chain invocation to the native function. */ @Override public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { if (Library.Handler.OBJECT_TOSTRING.equals(method)) { String str = "Proxy interface to " + function; Method m = (Method)options.get(Function.OPTION_INVOKING_METHOD); Class<?> cls = findCallbackClass(m.getDeclaringClass()); str += " (" + cls.getName() + ")"; return str; } else if (Library.Handler.OBJECT_HASHCODE.equals(method)) { return Integer.valueOf(hashCode()); } else if (Library.Handler.OBJECT_EQUALS.equals(method)) { Object o = args[0]; if (o != null && Proxy.isProxyClass(o.getClass())) { return Function.valueOf(Proxy.getInvocationHandler(o) == this); } return Boolean.FALSE; } if (Function.isVarArgs(method)) { args = Function.concatenateVarArgs(args); } return function.invoke(method.getReturnType(), args, options); }
f = functions.get(method); if (f == null) { boolean isVarArgs = Function.isVarArgs(method); InvocationHandler handler = null; if (invocationMapper != null) {
boolean isVarArgs = args.length > 0 && invokingMethod != null ? isVarArgs(invokingMethod) : false; int fixedArgs = args.length > 0 && invokingMethod != null ? fixedArgs(invokingMethod) : 0; for (int i=0; i < args.length; i++) {
/** Chain invocation to the native function. */ public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { if (Library.Handler.OBJECT_TOSTRING.equals(method)) { return "Proxy interface to " + function; } else if (Library.Handler.OBJECT_HASHCODE.equals(method)) { return new Integer(hashCode()); } else if (Library.Handler.OBJECT_EQUALS.equals(method)) { Object o = args[0]; if (o != null && Proxy.isProxyClass(o.getClass())) { return Boolean.valueOf(Proxy.getInvocationHandler(o) == this); } return Boolean.FALSE; } if (Function.isVarArgs(method)) { args = Function.concatenateVarArgs(args); } return function.invoke(method.getReturnType(), args, options); }
/** Chain invocation to the native function. */ @Override public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { if (Library.Handler.OBJECT_TOSTRING.equals(method)) { String str = "Proxy interface to " + function; Method m = (Method)options.get(Function.OPTION_INVOKING_METHOD); Class<?> cls = findCallbackClass(m.getDeclaringClass()); str += " (" + cls.getName() + ")"; return str; } else if (Library.Handler.OBJECT_HASHCODE.equals(method)) { return Integer.valueOf(hashCode()); } else if (Library.Handler.OBJECT_EQUALS.equals(method)) { Object o = args[0]; if (o != null && Proxy.isProxyClass(o.getClass())) { return Function.valueOf(Proxy.getInvocationHandler(o) == this); } return Boolean.FALSE; } if (Function.isVarArgs(method)) { args = Function.concatenateVarArgs(args); } return function.invoke(method.getReturnType(), args, options); }
f = functions.get(method); if (f == null) { boolean isVarArgs = Function.isVarArgs(method); InvocationHandler handler = null; if (invocationMapper != null) {
if (f == null) { f = new FunctionInfo(); f.isVarArgs = Function.isVarArgs(method); if (invocationMapper != null) { f.handler = invocationMapper.getInvocationHandler(nativeLibrary, method);
boolean isVarArgs = args.length > 0 && invokingMethod != null ? isVarArgs(invokingMethod) : false; int fixedArgs = args.length > 0 && invokingMethod != null ? fixedArgs(invokingMethod) : 0; for (int i=0; i < args.length; i++) {