All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pamirs.pradar.script.ScriptEvaluator Maven / Gradle / Ivy

There is a newer version: 1.0.2
Show newest version
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);
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy