net.xoetrope.optional.scripts.javascript
Class JavaScriptEngine

java.lang.Object
  extended by net.xoetrope.optional.scripts.javascript.JavaScriptEngine
All Implemented Interfaces:
ScriptEngine

public class JavaScriptEngine
extends java.lang.Object
implements ScriptEngine


Constructor Summary
JavaScriptEngine()
          Creates a new instance of JavaScriptEngine
 
Method Summary
 void configureScriptEnvironment(org.mozilla.javascript.Scriptable scope, org.mozilla.javascript.Context cx)
          Configures the current environment with some necessary variables
 java.lang.Object executeScript(java.lang.String script)
          Executes a given script and returns the result.
 java.lang.String getPageScript()
          Returns the scripts for this page
 void setProject(XProject proj)
          Set the owning project
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JavaScriptEngine

public JavaScriptEngine()
Creates a new instance of JavaScriptEngine

Parameters:
proj - the current project
Method Detail

setProject

public void setProject(XProject proj)
Set the owning project

Specified by:
setProject in interface ScriptEngine
Parameters:
proj - the current project

getPageScript

public java.lang.String getPageScript()
Returns the scripts for this page

Specified by:
getPageScript in interface ScriptEngine

configureScriptEnvironment

public void configureScriptEnvironment(org.mozilla.javascript.Scriptable scope,
                                       org.mozilla.javascript.Context cx)
Configures the current environment with some necessary variables


executeScript

public java.lang.Object executeScript(java.lang.String script)
                               throws ScriptException
Executes a given script and returns the result.

Specified by:
executeScript in interface ScriptEngine
Parameters:
script - the script to be executed for the current page
Throws:
ScriptException