scripting
Interface InterpreterDriver

All Known Implementing Classes:
JSInterpreterDriver

public interface InterpreterDriver

Defines the interface for a driver for a scripting language interpreter


Nested Class Summary
static class InterpreterDriver.InterpreterException
          An object of this class is thrown when an exception is generated while the interpreter is executing a script
 
Method Summary
 void executeScript(java.lang.String script, java.lang.String[] argNames, java.lang.String[] argValues)
          Executes the script code contained within the specified string
 void executeScriptFile(java.lang.String scriptFile, java.lang.String[] argNames, java.lang.String[] argValues)
          Executes script contained within a file
 java.lang.String[] getSupportedExtensions()
          Returns a list of all file extensions associated with the interpreter
 java.lang.String[] getSupportedLanguages()
          Returns a list of all languages supported by the interpreter
 void setVariable(java.lang.String name, java.lang.String value)
          Sets a variable/member to the specified value
 

Method Detail

executeScript

void executeScript(java.lang.String script,
                   java.lang.String[] argNames,
                   java.lang.String[] argValues)
                   throws InterpreterDriver.InterpreterException
Executes the script code contained within the specified string

Parameters:
script - the script code
argNames - an array containing the names of arguments to be passed to the evaluation
argValues - an array containing the values of the arguments to be passed to the evaluation
Throws:
InterpreterDriver.InterpreterException - if an exception occurs while interpreting the script

executeScriptFile

void executeScriptFile(java.lang.String scriptFile,
                       java.lang.String[] argNames,
                       java.lang.String[] argValues)
                       throws InterpreterDriver.InterpreterException
Executes script contained within a file

Parameters:
scriptFile - the file containing the script to be interpreted. This must include a suitable extension for the particular language
argNames - an array containing the names of arguments to be passed to the evaluation
argValues - an array containing the values of the arguments to be passed to the evaluation
Throws:
InterpreterDriver.InterpreterException - if an exception occurs while interpreting the script file

getSupportedExtensions

java.lang.String[] getSupportedExtensions()
Returns a list of all file extensions associated with the interpreter

Returns:
an array of string objects containing the supported extensions. These are case-sensitive and must not include the prepending '.' character

getSupportedLanguages

java.lang.String[] getSupportedLanguages()
Returns a list of all languages supported by the interpreter

Returns:
an array of string objects containing the supported languages. These are case-sensitive.

setVariable

void setVariable(java.lang.String name,
                 java.lang.String value)
Sets a variable/member to the specified value

Parameters:
name - the name of the variable to set
value - the value to assign the variable