org.formaria.scripts.groovy
Class GroovyScriptEngine

java.lang.Object
  extended by org.formaria.scripts.groovy.GroovyScriptEngine

public class GroovyScriptEngine
extends java.lang.Object

A scripting engine using Groovy

Copyright (c) Formaria Ltd., 2008

License: see license.txt


Field Summary
protected  GroovyClassLoader classLoader
           
protected  ExceptionHandler exceptionHandler
           
protected  GroovyShell groovyShell
           
protected  java.util.Hashtable referenceObjects
           
protected  java.lang.Object result
           
 
Constructor Summary
GroovyScriptEngine()
          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
 java.lang.Object loadClass(java.io.InputStream stream)
          Executes a given script and returns the result.
 void setProject(Project proj)
          Set the owning project
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

referenceObjects

protected java.util.Hashtable referenceObjects

groovyShell

protected GroovyShell groovyShell

classLoader

protected GroovyClassLoader classLoader

exceptionHandler

protected ExceptionHandler exceptionHandler

result

protected java.lang.Object result
Constructor Detail

GroovyScriptEngine

public GroovyScriptEngine()
Creates a new instance of JavaScriptEngine

Parameters:
proj - the current project
Method Detail

setProject

public void setProject(Project proj)
Set the owning project

Parameters:
proj - the current project

getPageScript

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


executeScript

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

Parameters:
script - the script to be executed for the current page
Throws:
ScriptException

loadClass

public java.lang.Object loadClass(java.io.InputStream stream)
                           throws ScriptException
Executes a given script and returns the result.

Parameters:
script - the script to be executed for the current page
Throws:
ScriptException