com.pamirs.pradar.script.ScriptEvaluator Maven / Gradle / Ivy
package com.pamirs.pradar.script;
import java.util.Map;
/**
* @author xiaobin.zfb|[email protected]
* @since 2021/6/18 2:31 下午
*/
public interface ScriptEvaluator {
/**
* script type
*
* @return
*/
String getType();
/**
* Evaluate the given script.
*
* @param script the ScriptSource for the script to evaluate
* @return the return value of the script, if any
*/
Object evaluate(String script);
/**
* Evaluate the given script with the given arguments.
*
* @param script the ScriptSource for the script to evaluate
* @param arguments the key-value pairs to expose to the script,
* typically as script variables (may be {@code null} or empty)
* @return the return value of the script, if any
*/
Object evaluate(String script, Map arguments);
/**
* Evaluate the given script with the given arguments.
*
* @param script the ScriptSource for the script to evaluate
* @param arguments the key-value pairs to expose to the script,
* typically as script variables (may be {@code null} or empty)
* @return the return value of the script, if any
*/
Object evaluate(ClassLoader classLoader, String script, Map arguments);
}