1 package org.simantics.scl.reflection.functions;
\r
3 import java.lang.reflect.InvocationTargetException;
\r
4 import java.lang.reflect.Method;
\r
6 import org.simantics.scl.runtime.function.FunctionImpl3;
\r
7 import org.simantics.scl.runtime.function.FunctionImplN;
\r
9 public class ClassMethodFunction3 extends FunctionImpl3 {
\r
12 public ClassMethodFunction3(Method method) {
\r
13 this.method = method;
\r
16 public Method getMethod() {
\r
21 public Object apply(Object p0, Object p1, Object p2) {
\r
23 return method.invoke(null, p0, p1, p2);
\r
24 } catch (IllegalArgumentException e) {
\r
25 throw new RuntimeException(e);
\r
26 } catch (IllegalAccessException e) {
\r
27 throw new RuntimeException(e);
\r
28 } catch (InvocationTargetException e) {
\r
29 //e.printStackTrace();
\r
30 throw new RuntimeException(e);
\r
35 public String toString() {
\r
36 return method.getName();
\r