ch.obermuhlner.scriptengine.java.execution.ExecutionStrategy Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of java-scriptengine Show documentation
Show all versions of java-scriptengine Show documentation
Java script engine for Java as a scripting language.
package ch.obermuhlner.scriptengine.java.execution;
import javax.script.ScriptException;
/**
* The strategy used to execute a method on an object instance.
*/
public interface ExecutionStrategy {
/**
* Executes a method on an object instance, or a static method if the specified instance is {@code null}.
*
* @param instance the object instance to be executed or {@code null} to execute a static method
* @return the return value of the method, or {@code null}
* @throws ScriptException if no method to execute was found
*/
Object execute(Object instance) throws ScriptException;
}