public <T, R> JFunction<T, R> ref(T thisObj, Class<R> returnType, String funcName) { return JFunctionX.def(thisObj, funcName, returnType); }
/** define function from static method of the caller */ public JFunction<Class<?>, Void> ref(String funcName) { Class<?> callerClz = CallerIntrospector.getCallingClass(); return JFunctionX.def(callerClz, funcName, void.class); }
/** * Answer an unbound instance function from the passed in thisObj that returns the passed in type. * Throws an exception if the instance method of the specific return type is not found. Note that * methods that are overloaded can not be used since there is no JavaScript/Rhino way to directly * overload a method. */ public <T> JFunction<T, Void> ref(T thisObj, String funcName) { return JFunctionX.def(thisObj, funcName, void.class); }
public <R> JFunction<Class<?>, R> ref(Class<?> clz, Class<R> returnType, String funcName) { return JFunctionX.def(clz, funcName, returnType); }