Public Member Functions | |
Scripter () | |
void | put (String name, Object object) |
Object | evaluate (String script) throws EvaluatorException, EcmaError |
ScriptFunction | getFunction (String name) |
void | source (String url) |
Package Attributes | |
Scriptable | scope |
Context | context |
HashMap< String, Object > | params = new HashMap<String, Object>() |
Classes | |
class | ScriptFunction |
ECMAScript code stored in a String can be evaluated via evaluate(..). java objects can be put into the script's top scope via put(..).
as the string needs to be interpreted everytime evaluate() is called, there is also the possibility to call an ECMAScript function defined via evaluate(). This Function is compiled only once at definition time and can be obtained by getFunction(), and evaluated on given arguments with their call(..) method.
Definition at line 37 of file Scripter.java.
org.hfbk.util.Scripter.Scripter | ( | ) |
Definition at line 44 of file Scripter.java.
References org.hfbk.util.Scripter.context, and org.hfbk.util.Scripter.scope.
void org.hfbk.util.Scripter.put | ( | String | name, | |
Object | object | |||
) |
make a java Object visible to the script's top scope.
name | ECMAScript variable name the object is assigned to. | |
object | the Object to put. |
Definition at line 55 of file Scripter.java.
References org.hfbk.util.Scripter.params.
Referenced by org.hfbk.vis.visnode.VisScript.renderSelf(), org.hfbk.util.ScriptShell.ScriptShell(), and org.hfbk.vis.VisClientScripter.VisClientScripter().
Here is the caller graph for this function:
Object org.hfbk.util.Scripter.evaluate | ( | String | script | ) | throws EvaluatorException, EcmaError |
invoke given script, returning the object that results, if any. doesn't catch errors.
script | the ECMAScript code |
EvaluatorException | if the script could not be parsed propperly. | |
EcmaError | if the script execution fails at runtime. |
Definition at line 67 of file Scripter.java.
References org.hfbk.util.Scripter.context, org.hfbk.util.Scripter.params, and org.hfbk.util.Scripter.scope.
Referenced by org.hfbk.vis.visnode.VisScript.renderSelf(), org.hfbk.vis.UdpListener.script(), org.hfbk.util.ScriptShell.ScriptShell(), org.hfbk.util.Scripter.source(), org.hfbk.vis.ScriptRouter.updateRoutes(), org.hfbk.vis.VisClientScripter.VisClientScripter(), and org.hfbk.vis.visnode.VisFunction.VisFunction().
Here is the caller graph for this function:
ScriptFunction org.hfbk.util.Scripter.getFunction | ( | String | name | ) |
gets the named script Function which needs to be defined by evaluating an ECMAScript function definition before.
Definition at line 85 of file Scripter.java.
References org.hfbk.util.Scripter.context, and org.hfbk.util.Scripter.scope.
Referenced by org.hfbk.vis.ScriptRouter.dispatch(), org.hfbk.vis.visnode.VisFunction.heightMap(), and org.hfbk.vis.visnode.VisScript.renderSelf().
Here is the caller graph for this function:
void org.hfbk.util.Scripter.source | ( | String | url | ) |
Definition at line 107 of file Scripter.java.
References org.hfbk.util.Scripter.evaluate().
Referenced by org.hfbk.vis.VisClientWindow.buildScriptsMenu().
Here is the call graph for this function:
Here is the caller graph for this function:
Scriptable org.hfbk.util.Scripter.scope [package] |
Definition at line 39 of file Scripter.java.
Referenced by org.hfbk.util.Scripter.ScriptFunction.call(), org.hfbk.util.Scripter.evaluate(), org.hfbk.util.Scripter.getFunction(), and org.hfbk.util.Scripter.Scripter().
Context org.hfbk.util.Scripter.context [package] |
Definition at line 40 of file Scripter.java.
Referenced by org.hfbk.util.Scripter.ScriptFunction.call(), org.hfbk.util.Scripter.evaluate(), org.hfbk.util.Scripter.getFunction(), and org.hfbk.util.Scripter.Scripter().
HashMap<String,Object> org.hfbk.util.Scripter.params = new HashMap<String, Object>() [package] |
Definition at line 42 of file Scripter.java.
Referenced by org.hfbk.util.Scripter.evaluate(), and org.hfbk.util.Scripter.put().