All Packages Class Hierarchy This Package Previous Next Index
Interface websphinx.workbench.ScriptInterpreter
- public interface ScriptInterpreter
-
apply(Object, Object[])
- Call a procedure or function.
-
eval(String)
- Evaluate an expression in the script language.
-
get(String)
- Get a variable defined in the interpreter's global
namespace
-
getLanguage()
- Return name of language this interpreter handles.
-
lambda(String[], String)
- Construct a procedure or function.
-
set(String, Object)
- Set a variable in the interpreter's global namespace
getLanguage
public abstract String getLanguage()
- Return name of language this interpreter handles.
- Returns:
- Language name, such as "Javascript" or "TCL"
eval
public abstract Object eval(String expression) throws ScriptException
- Evaluate an expression in the script language.
- Parameters:
- expression - Expression to evaluate
- Throws: ScriptException
- if execution encounters an error
lambda
public abstract Object lambda(String args[],
String body) throws ScriptException
- Construct a procedure or function.
- Parameters:
- args - Argument names
- body - Function body
- Returns:
- Function object suitable for apply()
- Throws: ScriptException
- if execution encounters an error
apply
public abstract Object apply(Object func,
Object args[]) throws ScriptException
- Call a procedure or function.
- Parameters:
- func - Function object (previously returned by lambda()
- args - Arguments for the function
- Throws: ScriptException
- if execution encounters an error
set
public abstract void set(String name,
Object object)
- Set a variable in the interpreter's global namespace
- Parameters:
- name - Name of variable
- object - New value for variable
get
public abstract Object get(String name)
- Get a variable defined in the interpreter's global
namespace
- Parameters:
- name - Name of variable to get
- Returns:
- Value of variable, or null if not defined
All Packages Class Hierarchy This Package Previous Next Index