-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
+package org.simantics.scl.reflection.functions;
+
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+
+import org.simantics.scl.runtime.function.FunctionImpl3;
+
+public class ClassMethodFunction3 extends FunctionImpl3 {
+ Method method;
+
+ public ClassMethodFunction3(Method method) {
+ this.method = method;
+ }
+
+ public Method getMethod() {
+ return method;
+ }
+
+ @Override
+ public Object apply(Object p0, Object p1, Object p2) {
+ try {
+ return method.invoke(null, p0, p1, p2);
+ } catch (IllegalArgumentException e) {
+ throw new RuntimeException(e);
+ } catch (IllegalAccessException e) {
+ throw new RuntimeException(e);
+ } catch (InvocationTargetException e) {
+ throw new RuntimeException(e.getCause());
+ }
+ }
+
+ @Override
+ public String toString() {
+ return method.getName();
+ }
+}