MetaDone
|
Classes | |
class | ScriptNotEvaluatedException |
Public Member Functions | |
EventScriptEvaluator (EventTower<?super ScriptCallEvent > manager) | |
void | clearVariables () |
void | reset () |
void | declareVariable (String name, Object value) |
final ProgLanguage | getLanguage () |
ScriptResult | evaluate (String script) |
Private Attributes | |
final HashMap< String, Object > | variables = new HashMap<String, Object>() |
final EventTower<?super ScriptCallEvent > | manager |
A script evaluator that uses the events so that the scripts could be evaluated by plugins.
metadone.metabusiness.script.plugin.EventScriptEvaluator.EventScriptEvaluator | ( | EventTower<?super ScriptCallEvent > | manager | ) |
Initializes this evaluator.
manager | The manager |
NullPointerException | when manager is null |
References metadone.metabusiness.script.plugin.EventScriptEvaluator.manager.
void metadone.metabusiness.script.plugin.EventScriptEvaluator.clearVariables | ( | ) |
Removes all the previously declared variables.
Implements metadone.metabusiness.script.ScriptEvaluator.
References metadone.metabusiness.script.plugin.EventScriptEvaluator.variables.
Referenced by metadone.metabusiness.script.plugin.EventScriptEvaluator.reset().
void metadone.metabusiness.script.plugin.EventScriptEvaluator.declareVariable | ( | String | name, |
Object | value | ||
) |
Declares a new variable called name and sets it to value.
updateContext() should be called afterwards.
name | The name of the variable |
value | The new value |
NullPointerException | when name is null |
Implements metadone.metabusiness.script.ScriptEvaluator.
References metadone.metabusiness.script.plugin.EventScriptEvaluator.variables.
ScriptResult metadone.metabusiness.script.plugin.EventScriptEvaluator.evaluate | ( | String | script | ) |
Evaluates a script and returns a result.
script | The script to evaluate |
NullPointerException | when script is null |
Implements metadone.metabusiness.script.ScriptEvaluator.
References metadone.metabusiness.events.ScriptCallEvent.getResult(), metadone.metabusiness.script.plugin.EventScriptEvaluator.manager, and metadone.metabusiness.script.plugin.EventScriptEvaluator.variables.
final ProgLanguage metadone.metabusiness.script.plugin.EventScriptEvaluator.getLanguage | ( | ) |
Gets the evaluated language.
Implements metadone.metabusiness.script.ScriptEvaluator.
void metadone.metabusiness.script.plugin.EventScriptEvaluator.reset | ( | ) |
Resets the script evaluator.
Implements metadone.metabusiness.script.ScriptEvaluator.
References metadone.metabusiness.script.plugin.EventScriptEvaluator.clearVariables().
final EventTower<? super ScriptCallEvent> metadone.metabusiness.script.plugin.EventScriptEvaluator.manager [private] |
final HashMap<String, Object> metadone.metabusiness.script.plugin.EventScriptEvaluator.variables = new HashMap<String, Object>() [private] |