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
8 public class ClassMethodFunction3 extends FunctionImpl3 {
\r
11 public ClassMethodFunction3(Method method) {
\r
12 this.method = method;
\r
15 public Method getMethod() {
\r
20 public Object apply(Object p0, Object p1, Object p2) {
\r
22 return method.invoke(null, p0, p1, p2);
\r
23 } catch (IllegalArgumentException e) {
\r
24 throw new RuntimeException(e);
\r
25 } catch (IllegalAccessException e) {
\r
26 throw new RuntimeException(e);
\r
27 } catch (InvocationTargetException e) {
\r
28 throw new RuntimeException(e.getCause());
\r
33 public String toString() {
\r
34 return method.getName();
\r