/** * Create a new SmartBinder from the given types and argument names. * * @param retType the type of the return value to start with * @param names the names of arguments * @param types the argument types * @return a new SmartBinder */ public static SmartBinder from(Class<?> retType, String[] names, Class<?>... types) { return from(Signature.returning(retType).appendArgs(names, types)); }
/** * Create a new SmartBinder with from the given types and argument name. * * @param retType the type of the return value to start with * @param name the name of the sole argument * @param type the sole argument's type * @return a new SmartBinder */ public static SmartBinder from(Class<?> retType, String name, Class<?> type) { return from(Signature.returning(retType).appendArg(name, type)); }
/** * Create a new SmartBinder from the given types and argument name, * using the given Lookup for any handle lookups. * * @param lookup the Lookup to use for handle lookups * @param retType the type of the return value to start with * @param name the name of the sole arguments * @param type the sole argument's type * @return a new SmartBinder */ public static SmartBinder from(Lookup lookup, Class<?> retType, String name, Class<?> type) { return from(lookup, Signature.returning(retType).appendArg(name, type)); }
/** * Create a new SmartBinder from the given types and argument names, * using the given Lookup for any handle lookups. * * @param lookup the Lookup to use for handle lookups * @param retType the type of the return value to start with * @param names the names of arguments * @param types the argument types * @return a new SmartBinder */ public static SmartBinder from(Lookup lookup, Class<?> retType, String[] names, Class<?>... types) { return from(lookup, Signature.returning(retType).appendArgs(names, types)); }
.returning(IRubyObject.class) .appendArg("context", ThreadContext.class) .appendArg("self", IRubyObject.class) .from(Signature.returning(MethodHandle.class).appendArg("targets", MethodHandle[].class).appendArg("arity", int.class)) .arrayGet(); .from(Signature.returning(MethodHandle.class).appendArg("args", IRubyObject[].class)) .filterReturn(HANDLE_GETTER.bindTo(varargsTargets)) .cast(int.class, Object.class)
.returning(IRubyObject.class) .appendArg("context", ThreadContext.class) .appendArg("self", IRubyObject.class) .from(Signature.returning(MethodHandle.class).appendArg("targets", MethodHandle[].class).appendArg("arity", int.class)) .arrayGet(); .from(Signature.returning(MethodHandle.class).appendArg("args", IRubyObject[].class)) .filterReturn(HANDLE_GETTER.bindTo(varargsTargets)) .cast(int.class, Object.class)