Class BeanShellScriptInterpreter
java.lang.Object
org.apache.maven.shared.scriptinterpreter.BeanShellScriptInterpreter
- All Implemented Interfaces:
Closeable,AutoCloseable,ScriptInterpreter
Provides a facade to evaluate BeanShell scripts.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final BeanShellScriptInterpreter.ChildFirstURLClassLoader -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()evaluateScript(String script, Map<String, ?> globalVariables, PrintStream scriptOutput) Evaluates the specified script.voidsetClassPath(List<String> classPath) Set class path used by interpreted.private URL
-
Field Details
-
classLoader
-
-
Constructor Details
-
BeanShellScriptInterpreter
BeanShellScriptInterpreter()
-
-
Method Details
-
setClassPath
Description copied from interface:ScriptInterpreterSet class path used by interpreted.- Specified by:
setClassPathin interfaceScriptInterpreter- Parameters:
classPath- The additional class path for the script interpreter, may benullor 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
-
evaluateScript
public Object evaluateScript(String script, Map<String, ?> globalVariables, PrintStream scriptOutput) throws ScriptEvaluationExceptionDescription copied from interface:ScriptInterpreterEvaluates the specified script.- Specified by:
evaluateScriptin interfaceScriptInterpreter- Parameters:
script- The script contents to evaluate, must not benull.globalVariables- The global variables (as a mapping from variable name to value) to define for the script, may benullif not used.scriptOutput- A print stream to redirect any output from the script to, may benullto use stdout/stderr.- Returns:
- The return value from the script, can be
null - Throws:
ScriptEvaluationException- If the script evaluation produced an error.
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-