net.xoetrope.optional.scripts.beanshell
Class BeanShellScriptEngine

java.lang.Object
  extended by net.xoetrope.optional.scripts.beanshell.BeanShellScriptEngine
All Implemented Interfaces:
ScriptEngine

public class BeanShellScriptEngine
extends java.lang.Object
implements ScriptEngine

Evaluates a script attribute by passing the scripts following the prefix 'script:' to the ScriptEngine. The scripts can be an a function that was predifined in the page Scripts tag or a script that is just being defined. eg. script:myFunction(); given that myFunction was define in the page Scripts tag. eg. script:out.println('Hello World'); the script is just being defined.

Copyright (c) Xoetrope Ltd., 2002-2007

License: see license.txt


Constructor Summary
BeanShellScriptEngine()
          Creates a new instance of JavaScriptEngine
 
Method Summary
 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

BeanShellScriptEngine

public BeanShellScriptEngine()
Creates a new instance of JavaScriptEngine

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

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