public interface Interpreter extends FactoryManaged
| Modifier and Type | Method and Description |
|---|---|
Object |
call(String functionName,
Object[] arguments)
Call a function defined by the program passing the objects as arguments.
|
void |
execute()
Execute the program.
|
Object |
getVariable(String name)
Get the value of a global variable.
|
void |
registerFunctions(Class<?> klass)
Register the functions defined in the class.
|
void |
registerHook(InterpreterHook hook) |
void |
setErrorWriter(Writer writer) |
void |
setProgram(BuildableProgram buildableProgram)
Set the program to execute.
|
void |
setReader(Reader reader) |
void |
setVariable(String name,
Object value)
Set the value of the global variable.
|
void |
setWriter(Writer writer) |
setFactoryvoid registerHook(InterpreterHook hook)
void setProgram(BuildableProgram buildableProgram)
buildableProgram - void execute()
throws ExecutionException
ExecutionExceptionvoid setVariable(String name, Object value) throws ExecutionException
name - the name of the global variablevalue - the value to be setExecutionExceptionObject getVariable(String name) throws ExecutionException
BasicDoubleValue then the
implementation should return a Double.name - the name of the variableExecutionExceptionObject call(String functionName, Object[] arguments) throws ExecutionException
functionName - the name of the function in the program codearguments - the arguments to the functionnull if the function does not
return valueExecutionExceptionvoid setReader(Reader reader)
reader - ScriptContext.setReader(java.io.Reader)void setWriter(Writer writer)
writer - ScriptContext.setWriter(Writer)void setErrorWriter(Writer writer)
writer - ScriptContext.setErrorWriter(Writer)void registerFunctions(Class<?> klass)
@Functionklass - the class the defines the functions.Copyright © 2013 Verhas and Verhas Software Craftsmen. All Rights Reserved.