Package VASSAL.script
Class BeanShell
java.lang.Object
VASSAL.script.BeanShell
public class BeanShell extends Object
Class encapsulating BeanShell support in Vassal
-
Field Summary
Fields Modifier and Type Field Description static StringFALSEprotected ScriptInterpreterglobalInterpreterprotected static StringINIT_SCRIPTstatic StringTRUE -
Constructor Summary
Constructors Constructor Description BeanShell() -
Method Summary
Modifier and Type Method Description CompileResultcompile(Reader in)voidexecuteActionScript(String scriptName)Execute a Script named in a component DoAction or trait DoAction.bsh.NameSpacegetGlobalNameSpace()Return the Vassal shared NameSpacestatic BeanShellgetInstance()voidinit()static booleanvalidateExpression(String expression)Parse and validate a single expression or script.static Objectwrap(String value)Convert a String value into a wrapped primitive object if possible.
-
Field Details
-
TRUE
- See Also:
- Constant Field Values
-
FALSE
- See Also:
- Constant Field Values
-
INIT_SCRIPT
- See Also:
- Constant Field Values
-
globalInterpreter
-
-
Constructor Details
-
BeanShell
public BeanShell()
-
-
Method Details
-
getInstance
-
init
public void init() -
compile
-
getGlobalNameSpace
public bsh.NameSpace getGlobalNameSpace()Return the Vassal shared NameSpace- Returns:
- Global NameSpace
-
executeActionScript
Execute a Script named in a component DoAction or trait DoAction. Action Scripts take no parameters and return no value.- Parameters:
scriptName- Script name
-
validateExpression
Parse and validate a single expression or script. No evaluation or checking for undefined variables- Parameters:
expression- Expression to validate
-
wrap
Convert a String value into a wrapped primitive object if possible.- Parameters:
value- Value to Wrap- Returns:
- wrapped value
-