--- /dev/null
+package org.simantics.scl.reflection.functions;\r
+\r
+import java.lang.reflect.InvocationTargetException;\r
+import java.lang.reflect.Method;\r
+\r
+import org.simantics.scl.runtime.function.FunctionImpl3;\r
+import org.simantics.scl.runtime.function.FunctionImplN;\r
+\r
+public class ClassMethodFunction3 extends FunctionImpl3 {\r
+ Method method;\r
+\r
+ public ClassMethodFunction3(Method method) {\r
+ this.method = method;\r
+ }\r
+ \r
+ public Method getMethod() {\r
+ return method;\r
+ }\r
+\r
+ @Override\r
+ public Object apply(Object p0, Object p1, Object p2) {\r
+ try {\r
+ return method.invoke(null, p0, p1, p2);\r
+ } catch (IllegalArgumentException e) {\r
+ throw new RuntimeException(e);\r
+ } catch (IllegalAccessException e) {\r
+ throw new RuntimeException(e);\r
+ } catch (InvocationTargetException e) {\r
+ //e.printStackTrace();\r
+ throw new RuntimeException(e);\r
+ }\r
+ }\r
+ \r
+ @Override\r
+ public String toString() {\r
+ return method.getName();\r
+ }\r
+}\r