List of usage examples for javax.script Invocable invokeFunction
public Object invokeFunction(String name, Object... args) throws ScriptException, NoSuchMethodException;
From source file:org.eclairjs.nashorn.sql.JSUDF10.java
@SuppressWarnings({ "null", "unchecked" }) @Override//from w ww . j a v a 2s . c om public Object call(Object o, Object o2, Object o3, Object o4, Object o5, Object o6, Object o7, Object o8, Object o9, Object o10) throws Exception { ScriptEngine e = NashornEngineSingleton.getEngine(); if (this.fn == null) { this.fn = e.eval(func); } Invocable invocable = (Invocable) e; Object params[] = { this.fn, o, o2, o3, o4, o5, o6, o7, o8, o9, o10 }; if (this.args != null && this.args.length > 0) { params = ArrayUtils.addAll(params, this.args); } Object ret = invocable.invokeFunction("Utils_invoke", params); ret = this.castValueToReturnType(ret); return ret; }
From source file:org.eclairjs.nashorn.sql.JSUDF11.java
@SuppressWarnings({ "null", "unchecked" }) @Override//www . ja v a 2 s . c om public Object call(Object o, Object o2, Object o3, Object o4, Object o5, Object o6, Object o7, Object o8, Object o9, Object o10, Object o11) throws Exception { ScriptEngine e = NashornEngineSingleton.getEngine(); if (this.fn == null) { this.fn = e.eval(func); } Invocable invocable = (Invocable) e; Object params[] = { this.fn, o, o2, o3, o4, o5, o6, o7, o8, o9, o10, o11 }; if (this.args != null && this.args.length > 0) { params = ArrayUtils.addAll(params, this.args); } Object ret = invocable.invokeFunction("Utils_invoke", params); ret = this.castValueToReturnType(ret); return ret; }
From source file:org.eclairjs.nashorn.sql.JSUDF12.java
@SuppressWarnings({ "null", "unchecked" }) @Override/* w w w . java2 s . co m*/ public Object call(Object o, Object o2, Object o3, Object o4, Object o5, Object o6, Object o7, Object o8, Object o9, Object o10, Object o11, Object o12) throws Exception { ScriptEngine e = NashornEngineSingleton.getEngine(); if (this.fn == null) { this.fn = e.eval(func); } Invocable invocable = (Invocable) e; Object params[] = { this.fn, o, o2, o3, o4, o5, o6, o7, o8, o9, o10, o11, o12 }; if (this.args != null && this.args.length > 0) { params = ArrayUtils.addAll(params, this.args); } Object ret = invocable.invokeFunction("Utils_invoke", params); ret = this.castValueToReturnType(ret); return ret; }
From source file:org.eclairjs.nashorn.sql.JSUDF13.java
@SuppressWarnings({ "null", "unchecked" }) @Override/*ww w. j a v a2 s. c o m*/ public Object call(Object o, Object o2, Object o3, Object o4, Object o5, Object o6, Object o7, Object o8, Object o9, Object o10, Object o11, Object o12, Object o13) throws Exception { ScriptEngine e = NashornEngineSingleton.getEngine(); if (this.fn == null) { this.fn = e.eval(func); } Invocable invocable = (Invocable) e; Object params[] = { this.fn, o, o2, o3, o4, o5, o6, o7, o8, o9, o10, o11, o12, o13 }; if (this.args != null && this.args.length > 0) { params = ArrayUtils.addAll(params, this.args); } Object ret = invocable.invokeFunction("Utils_invoke", params); ret = this.castValueToReturnType(ret); return ret; }
From source file:org.eclairjs.nashorn.sql.JSUDF14.java
@SuppressWarnings({ "null", "unchecked" }) @Override//from ww w . j a v a 2 s.c om public Object call(Object o, Object o2, Object o3, Object o4, Object o5, Object o6, Object o7, Object o8, Object o9, Object o10, Object o11, Object o12, Object o13, Object o14) throws Exception { ScriptEngine e = NashornEngineSingleton.getEngine(); if (this.fn == null) { this.fn = e.eval(func); } Invocable invocable = (Invocable) e; Object params[] = { this.fn, o, o2, o3, o4, o5, o6, o7, o8, o9, o10, o11, o12, o13, o14 }; if (this.args != null && this.args.length > 0) { params = ArrayUtils.addAll(params, this.args); } Object ret = invocable.invokeFunction("Utils_invoke", params); ret = this.castValueToReturnType(ret); return ret; }
From source file:org.eclairjs.nashorn.sql.JSUDF15.java
@SuppressWarnings({ "null", "unchecked" }) @Override/* w ww .j a va2s. c o m*/ public Object call(Object o, Object o2, Object o3, Object o4, Object o5, Object o6, Object o7, Object o8, Object o9, Object o10, Object o11, Object o12, Object o13, Object o14, Object o15) throws Exception { ScriptEngine e = NashornEngineSingleton.getEngine(); if (this.fn == null) { this.fn = e.eval(func); } Invocable invocable = (Invocable) e; Object params[] = { this.fn, o, o2, o3, o4, o5, o6, o7, o8, o9, o10, o11, o12, o13, o14, o15 }; if (this.args != null && this.args.length > 0) { params = ArrayUtils.addAll(params, this.args); } Object ret = invocable.invokeFunction("Utils_invoke", params); ret = this.castValueToReturnType(ret); return ret; }
From source file:org.eclairjs.nashorn.sql.JSUDF16.java
@SuppressWarnings({ "null", "unchecked" }) @Override// ww w. j a v a2 s . c o m public Object call(Object o, Object o2, Object o3, Object o4, Object o5, Object o6, Object o7, Object o8, Object o9, Object o10, Object o11, Object o12, Object o13, Object o14, Object o15, Object o16) throws Exception { ScriptEngine e = NashornEngineSingleton.getEngine(); if (this.fn == null) { this.fn = e.eval(func); } Invocable invocable = (Invocable) e; Object params[] = { this.fn, o, o2, o3, o4, o5, o6, o7, o8, o9, o10, o11, o12, o13, o14, o15, o16 }; if (this.args != null && this.args.length > 0) { params = ArrayUtils.addAll(params, this.args); } Object ret = invocable.invokeFunction("Utils_invoke", params); ret = this.castValueToReturnType(ret); return ret; }
From source file:org.eclairjs.nashorn.sql.JSUDF17.java
@SuppressWarnings({ "null", "unchecked" }) @Override//www .j a va 2s . c o m public Object call(Object o, Object o2, Object o3, Object o4, Object o5, Object o6, Object o7, Object o8, Object o9, Object o10, Object o11, Object o12, Object o13, Object o14, Object o15, Object o16, Object o17) throws Exception { ScriptEngine e = NashornEngineSingleton.getEngine(); if (this.fn == null) { this.fn = e.eval(func); } Invocable invocable = (Invocable) e; Object params[] = { this.fn, o, o2, o3, o4, o5, o6, o7, o8, o9, o10, o11, o12, o13, o14, o15, o16, o17 }; if (this.args != null && this.args.length > 0) { params = ArrayUtils.addAll(params, this.args); } Object ret = invocable.invokeFunction("Utils_invoke", params); ret = this.castValueToReturnType(ret); return ret; }
From source file:org.eclairjs.nashorn.JSComparator.java
@SuppressWarnings({ "null", "unchecked" }) @Override// w w w . j av a 2 s. co m public boolean equals(Object o) { boolean ret = false; try { ScriptEngine e = NashornEngineSingleton.getEngine(); if (this.fn == null) { this.fn = e.eval(func); } Invocable invocable = (Invocable) e; Object params[] = { this.fn, o }; if (this.args != null && this.args.length > 0) { params = ArrayUtils.addAll(params, this.args); } ret = Boolean.valueOf(invocable.invokeFunction(this.functionName, params).toString()); } catch (Exception exc) { // do nothing for now } return ret; }
From source file:org.eclairjs.nashorn.sql.JSUDF18.java
@SuppressWarnings({ "null", "unchecked" }) @Override/*from www . j a v a 2 s . co m*/ public Object call(Object o, Object o2, Object o3, Object o4, Object o5, Object o6, Object o7, Object o8, Object o9, Object o10, Object o11, Object o12, Object o13, Object o14, Object o15, Object o16, Object o17, Object o18) throws Exception { ScriptEngine e = NashornEngineSingleton.getEngine(); if (this.fn == null) { this.fn = e.eval(func); } Invocable invocable = (Invocable) e; Object params[] = { this.fn, o, o2, o3, o4, o5, o6, o7, o8, o9, o10, o11, o12, o13, o14, o15, o16, o17, o18 }; if (this.args != null && this.args.length > 0) { params = ArrayUtils.addAll(params, this.args); } Object ret = invocable.invokeFunction("Utils_invoke", params); ret = this.castValueToReturnType(ret); return ret; }