public class BeanShellScript extends AbstractScript
RM_DEFAULT, RM_RESULT, RM_SCRIPT, SL_BEANSHELL, SL_DEFAULT, SL_GROOVY, STR_VALUES_FALSE, STR_VALUES_TRUE| Constructor and Description |
|---|
BeanShellScript(java.lang.String _src) |
BeanShellScript(java.lang.String _src,
boolean _precompile) |
BeanShellScript(java.lang.String _src,
boolean _precompile,
BeanShellScript _parent) |
BeanShellScript(java.lang.String _src,
boolean _precompile,
BeanShellScript _parent,
java.lang.ClassLoader _classloader) |
BeanShellScript(java.lang.String _src,
boolean _precompile,
BeanShellScript _parent,
java.lang.ClassLoader _classloader,
java.util.Map _initialvars) |
BeanShellScript(java.lang.String _src,
boolean _precompile,
BeanShellScript _parent,
java.lang.ClassLoader _classloader,
java.util.Map _initialvars,
java.util.List<ScriptImport> _defaultImports) |
| Modifier and Type | Method and Description |
|---|---|
java.lang.Object |
boolConverter(java.lang.Object o,
java.lang.Object nullValue) |
boolean |
checkNS() |
void |
clear()
Frees all variables of this script after execution to prevent them
from being held "forever" and causing memory leaks.
|
void |
close()
Closes this script instance, freeing up resources.
|
void |
compile()
macht die Syntax-Ueberpruefung
|
void |
compileNT(int _lineOffset,
java.lang.String errorTip)
macht die Syntax-Ueberpruefung aber NoThrow
|
ScriptFunctionI |
createFunction(java.lang.String _src,
java.lang.String[] parmNames,
java.lang.Class[] parmTypes,
java.lang.Class returnType)
Creates a function from a script source string.
|
ScriptFunctionI |
createFunction(java.lang.String _src,
java.lang.String[] parmNames,
java.lang.Class[] parmTypes,
java.lang.Class returnType,
java.lang.String _sn) |
ScriptFunctionI |
createFunction(java.lang.String _src,
java.lang.String[] parmNames,
java.lang.Class[] parmTypes,
java.lang.Class returnType,
java.lang.String _sn,
java.lang.String _fn)
Creates a function from a script source string.
|
ScriptFunctionI |
createFunction(java.lang.String _src,
java.lang.String[] parmNames,
java.lang.Class[] parmTypes,
java.lang.Class returnType,
java.lang.String _sn,
java.lang.String _fn,
int _lineOffset)
Creates a function from a script source string.
|
ScriptFunctionI |
createFunction(java.lang.String _src,
java.lang.String[] parmNames,
java.lang.Class[] parmTypes,
java.lang.Class returnType,
java.lang.String _sn,
java.lang.String _fn,
int _lineOffset,
java.lang.Object _delegate)
Creates a function from a script source string.
|
boolean |
evalAsBoolNT(java.lang.String s,
boolean nullValue,
int _lineOffset,
java.lang.String errorTip)
Evaluates a string as a script with a specified null value and line offset and returns the result as boolean.
|
java.lang.Object |
evalNT(java.lang.String s,
java.lang.Object nullValue,
int _lineOffset,
java.lang.String errorTip)
Evaluates a string as a script with a specified null value and line offset and returns the result as Object.
|
java.lang.Object |
evalNT(java.lang.String s,
java.lang.Object nullValue,
int _lineOffset,
java.lang.String errorTip,
java.util.function.BiFunction typeConverter) |
java.util.Map |
getAllVarMap() |
java.lang.Object |
getAsyncRc() |
java.lang.String |
getImports() |
bsh.Interpreter |
getInterpreter() |
java.lang.String |
getLanguage()
Returns the scripting language of this script instance.
|
int |
getLineOffset() |
java.lang.String |
getMname() |
bsh.NameSpace |
getNs() |
java.lang.String |
getNSName() |
java.lang.Object |
getNT(java.lang.String s,
java.lang.Object exValue)
Gets the value of a variable from the script context.
|
BeanShellScript |
getParent() |
java.lang.String |
getSource()
Returns the source code of this script.
|
java.lang.String |
getSrc() |
boolean |
hasSource()
Checks if this script has source code.
|
boolean |
isCompiled() |
boolean |
isPrecompile() |
boolean |
isSource(java.lang.String s) |
static void |
main(java.lang.String[] args) |
void |
run() |
java.lang.Object |
runAsObjectNT()
Runs the script and returns the result as an object, with
null as default null value. |
java.lang.Object |
runAsObjectNT(java.lang.Object nullValue)
Runs the script with a specified default null value.
|
java.lang.Object |
runAsObjectNT(java.lang.Object nullValue,
int _lineOffset)
Runs the script with a specified null value and line offset.
|
java.lang.Object |
runAsObjectNT(java.lang.Object nullValue,
int _lineOffset,
java.lang.String errorTip)
Runs the script with a specified null value, line offset, and error tip.
|
void |
runNT()
FIXME: lineOffset = wenn das BeanShellScript im Kontext eines grossen Skripts laeuft,
kann man mittels des Offsets die "Startzeile" des aktuellen Skripts mitgeben
|
void |
runNT(int _lineOffset)
Runs the script with a specified line offset.
|
void |
runNT(int _lineOffset,
java.lang.String errorTip)
Runs the script with a specified line offset and error tip.
|
void |
setAsyncRc(java.lang.Object $22) |
void |
setCompiled(boolean $20) |
void |
setImports(java.lang.String $16) |
void |
setInterpreter(bsh.Interpreter $14) |
void |
setLineOffset(int $18)
Sets an offset for line numbers, used for error reporting.
|
void |
setMname(java.lang.String $19) |
void |
setNs(bsh.NameSpace $23) |
void |
setNT(java.lang.String s,
java.lang.Object value,
boolean local)
Sets a variable, optionally with local scope.
|
void |
setParent(BeanShellScript $15) |
void |
setPrecompile(boolean $21)
Sets the pre-compile flag.
|
void |
setSource(java.lang.String _src)
Sets the source code of this script.
|
void |
setSrc(java.lang.String $17) |
asBool, asString, compileNT, compileNT, evalAsBoolNT, evalAsBoolNT, evalAsBoolNT, evalAsStringNT, evalAsStringNT, evalAsStringNT, evalAsStringNT, evalNT, evalNT, evalNT, getInstance, getInstance, getInstance, getInstance, getInstance, getInstance, getInstance, getInstance, getInstance, getInstance, getInstance, getInstance, getInstance, getInstance, getInstance, getInterrupt, getJavaSyntaxImports, getJavaSyntaxImports, getNT, isScriptException, runAsBoolNT, runAsBoolNT, runAsBoolNT, runAsBoolNT, runAsStringNT, runAsStringNT, runAsStringNT, runAsStringNT, setInterrupt, setNT, setNT, setNT, setNT, setNT, setNT, setNT, setNT, setNT, setNT, setNT, setNTpublic BeanShellScript(java.lang.String _src)
public BeanShellScript(java.lang.String _src,
boolean _precompile)
public BeanShellScript(java.lang.String _src,
boolean _precompile,
BeanShellScript _parent)
public BeanShellScript(java.lang.String _src,
boolean _precompile,
BeanShellScript _parent,
java.lang.ClassLoader _classloader)
public BeanShellScript(java.lang.String _src,
boolean _precompile,
BeanShellScript _parent,
java.lang.ClassLoader _classloader,
java.util.Map _initialvars)
public BeanShellScript(java.lang.String _src,
boolean _precompile,
BeanShellScript _parent,
java.lang.ClassLoader _classloader,
java.util.Map _initialvars,
java.util.List<ScriptImport> _defaultImports)
public java.lang.String getLanguage()
AbstractScriptgetLanguage in class AbstractScriptpublic java.lang.String getNSName()
public java.lang.String getSource()
AbstractScriptgetSource in class AbstractScriptpublic void setSource(java.lang.String _src)
AbstractScriptsetSource in class AbstractScript_src - The new source code as a String.public void close()
AbstractScriptclose in class AbstractScriptpublic void clear()
AbstractScriptclear in class AbstractScriptpublic ScriptFunctionI createFunction(java.lang.String _src, java.lang.String[] parmNames, java.lang.Class[] parmTypes, java.lang.Class returnType)
AbstractScriptcreateFunction in class AbstractScript_src - The script source code.parmNames - An array of names for the function's parameters.parmTypes - An array of Class objects representing the types of the function's parameters.returnType - The Class object representing the return type of the function.ScriptFunctionI instance representing the created function.public ScriptFunctionI createFunction(java.lang.String _src, java.lang.String[] parmNames, java.lang.Class[] parmTypes, java.lang.Class returnType, java.lang.String _sn)
public ScriptFunctionI createFunction(java.lang.String _src, java.lang.String[] parmNames, java.lang.Class[] parmTypes, java.lang.Class returnType, java.lang.String _sn, java.lang.String _fn)
AbstractScriptcreateFunction in class AbstractScript_src - The script source code.parmNames - An array of names for the function's parameters.parmTypes - An array of Class objects representing the types of the function's parameters.returnType - The Class object representing the return type of the function._sn - The name of the script, used for debugging and error reporting._fn - The name of the function.ScriptFunctionI instance representing the created function.public ScriptFunctionI createFunction(java.lang.String _src, java.lang.String[] parmNames, java.lang.Class[] parmTypes, java.lang.Class returnType, java.lang.String _sn, java.lang.String _fn, int _lineOffset)
AbstractScriptcreateFunction in class AbstractScript_src - The script source code.parmNames - An array of names for the function's parameters.parmTypes - An array of Class objects representing the types of the function's parameters.returnType - The Class object representing the return type of the function._sn - The name of the script, used for debugging and error reporting._fn - The name of the function._lineOffset - An integer line offset to use for error reporting.ScriptFunctionI instance representing the created function.public ScriptFunctionI createFunction(java.lang.String _src, java.lang.String[] parmNames, java.lang.Class[] parmTypes, java.lang.Class returnType, java.lang.String _sn, java.lang.String _fn, int _lineOffset, java.lang.Object _delegate)
AbstractScriptcreateFunction in class AbstractScript_src - The script source code.parmNames - An array of names for the function's parameters.parmTypes - An array of Class objects representing the types of the function's parameters.returnType - The Class object representing the return type of the function._sn - The name of the script, used for debugging and error reporting._fn - The name of the function._lineOffset - An integer line offset to use for error reporting._delegate - The object to which the function's method calls will be delegated.ScriptFunctionI instance representing the created function.public java.util.Map getAllVarMap()
public void run()
throws bsh.EvalError
bsh.EvalErrorpublic boolean isSource(java.lang.String s)
public boolean hasSource()
AbstractScripthasSource in class AbstractScriptpublic void runNT()
runNT in class AbstractScriptpublic void runNT(int _lineOffset)
AbstractScriptrunNT in class AbstractScript_lineOffset - An integer line offset to use for error reporting.public void runNT(int _lineOffset,
java.lang.String errorTip)
AbstractScriptrunNT in class AbstractScript_lineOffset - An integer line offset to use for error reporting.errorTip - A string to use as an error message tip if compilation fails.public void compile()
throws bsh.EvalError
bsh.EvalErrorpublic void compileNT(int _lineOffset,
java.lang.String errorTip)
compileNT in class AbstractScript_lineOffset - An integer line offset to use for error reporting.errorTip - A string to use as an error message tip if compilation fails.public java.lang.Object runAsObjectNT()
AbstractScriptnull as default null value.runAsObjectNT in class AbstractScriptpublic java.lang.Object runAsObjectNT(java.lang.Object nullValue)
AbstractScriptrunAsObjectNT in class AbstractScriptnullValue - The value to return if the script returns null.public java.lang.Object runAsObjectNT(java.lang.Object nullValue,
int _lineOffset)
AbstractScriptrunAsObjectNT in class AbstractScriptnullValue - The value to return if the script returns null._lineOffset - An integer line offset to use for error reporting.public java.lang.Object runAsObjectNT(java.lang.Object nullValue,
int _lineOffset,
java.lang.String errorTip)
AbstractScriptrunAsObjectNT in class AbstractScriptnullValue - The value to return if the script returns null._lineOffset - An integer line offset to use for error reporting.errorTip - A string to use as an error message tip if compilation fails.public boolean checkNS()
public void setNT(java.lang.String s,
java.lang.Object value,
boolean local)
AbstractScriptsetNT in class AbstractScripts - The name of the variable to set.value - The value of the variable to set.local - A flag indicating if the variable shall have a local scope.public java.lang.Object getNT(java.lang.String s,
java.lang.Object exValue)
AbstractScriptgetNT in class AbstractScripts - The name of the variable to retrieve the value of.exValue - This parameter is unused in all implementing classes. Maybe it was once intended to be a default value?public java.lang.Object evalNT(java.lang.String s,
java.lang.Object nullValue,
int _lineOffset,
java.lang.String errorTip)
AbstractScriptevalNT in class AbstractScripts - The source of the script to evaluate.nullValue - The value to return if the evaluation returns null._lineOffset - An integer line offset to use for error reporting.errorTip - A string to use as an error message tip if evaluation fails.public java.lang.Object evalNT(java.lang.String s,
java.lang.Object nullValue,
int _lineOffset,
java.lang.String errorTip,
java.util.function.BiFunction typeConverter)
public boolean evalAsBoolNT(java.lang.String s,
boolean nullValue,
int _lineOffset,
java.lang.String errorTip)
AbstractScriptevalAsBoolNT in class AbstractScripts - The source of the script to evaluate.nullValue - The value to return if the evaluation returns null._lineOffset - An integer line offset to use for error reporting.errorTip - A string to use as an error message tip if evaluation fails.public java.lang.Object boolConverter(java.lang.Object o,
java.lang.Object nullValue)
public static void main(java.lang.String[] args)
public bsh.Interpreter getInterpreter()
public void setInterpreter(bsh.Interpreter $14)
public BeanShellScript getParent()
public void setParent(BeanShellScript $15)
public java.lang.String getImports()
public void setImports(java.lang.String $16)
public java.lang.String getSrc()
public void setSrc(java.lang.String $17)
public int getLineOffset()
public void setLineOffset(int $18)
AbstractScriptsetLineOffset in class AbstractScript$18 - The line offset.public java.lang.String getMname()
public void setMname(java.lang.String $19)
public boolean isCompiled()
public void setCompiled(boolean $20)
public boolean isPrecompile()
public void setPrecompile(boolean $21)
AbstractScriptsetPrecompile in class AbstractScript$21 - The boolean value for the pre-compile flag.public java.lang.Object getAsyncRc()
public void setAsyncRc(java.lang.Object $22)
public bsh.NameSpace getNs()
public void setNs(bsh.NameSpace $23)
Copyright © 2000-2025 OAshi S.à r.l. All Rights Reserved.