Class BeanShellScriptInterpreter

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable, ScriptInterpreter

    class BeanShellScriptInterpreter
    extends java.lang.Object
    implements ScriptInterpreter
    Provides a facade to evaluate BeanShell scripts.
    • Constructor Detail

      • BeanShellScriptInterpreter

        BeanShellScriptInterpreter()
    • Method Detail

      • setClassPath

        public void setClassPath​(java.util.List<java.lang.String> classPath)
        Description copied from interface: ScriptInterpreter
        Set class path used by interpreted.
        Specified by:
        setClassPath in interface ScriptInterpreter
        Parameters:
        classPath - The additional class path for the script interpreter, may be null or empty if only the plugin realm should be used for the script evaluation. If specified, this class path will precede the artifacts from the plugin class path.
      • toUrl

        private java.net.URL toUrl​(java.lang.String path)
      • evaluateScript

        public java.lang.Object evaluateScript​(java.lang.String script,
                                               java.util.Map<java.lang.String,​?> globalVariables,
                                               java.io.PrintStream scriptOutput)
                                        throws ScriptEvaluationException
        Description copied from interface: ScriptInterpreter
        Evaluates the specified script.
        Specified by:
        evaluateScript in interface ScriptInterpreter
        Parameters:
        script - The script contents to evaluate, must not be null.
        globalVariables - The global variables (as a mapping from variable name to value) to define for the script, may be null if not used.
        scriptOutput - A print stream to redirect any output from the script to, may be null to use stdout/stderr.
        Returns:
        The return value from the script, can be null
        Throws:
        ScriptEvaluationException - If the script evaluation produced an error.
      • close

        public void close()
                   throws java.io.IOException
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Throws:
        java.io.IOException