org.snapscript.tree.define.AnyInvocationGenerator Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of snap Show documentation
Show all versions of snap Show documentation
Dynamic scripting for the JVM
package org.snapscript.tree.define;
import java.lang.reflect.Constructor;
import org.snapscript.core.function.Invocation;
public class AnyInvocationGenerator {
public AnyInvocationGenerator() {
super();
}
public Invocation create(Class invoke) throws Exception {
Constructor constructor = invoke.getDeclaredConstructor();
if(!constructor.isAccessible()) {
constructor.setAccessible(true);
}
return (Invocation)constructor.newInstance();
}
}