Package tv.phantombot.script
Class RhinoRuntime
java.lang.Object
tv.phantombot.script.RhinoRuntime
Rhino runtime environment configuration and management.
- Author:
- sartharon
-
Method Summary
Modifier and TypeMethodDescriptionstatic StringcallGlobalExposedScriptMethod(String method, String arg) static voidExposePropertyToScripts(String propertyName, Object property) Expose a property to all scripts via the$api.protected static org.mozilla.javascript.ScriptableObjectGet the shared default Phantombot Rhino runtime script scopestatic RhinoContextFactoryGet the Rhino ContextFactory instance.static voidinit(boolean enableGuiDebugger) Initialize the Rhino runtime environment with optional GUI debugger.
-
Method Details
-
getContextFactory
Get the Rhino ContextFactory instance. -
init
public static void init(boolean enableGuiDebugger) Initialize the Rhino runtime environment with optional GUI debugger.- Parameters:
enableGuiDebugger- true to enable the GUI debugger, false otherwise.
-
getBaseScope
protected static org.mozilla.javascript.ScriptableObject getBaseScope()Get the shared default Phantombot Rhino runtime script scope -
callGlobalExposedScriptMethod
-
ExposePropertyToScripts
Expose a property to all scripts via the$api. Scripts can later use$.propertyand$.property.function()to access these- Parameters:
propertyName- The name of the property visible to the scriptsproperty- The property object to be exposed to the scripts
-