net.sf.sail.core.activity.model
Class ScriptSupport

java.lang.Object
  extended by net.sf.sail.core.activity.model.ScriptSupport
All Implemented Interfaces:
IScript

public class ScriptSupport
extends java.lang.Object
implements IScript

Author:
eburke

Field Summary
protected  javax.script.CompiledScript compiled
           
protected  javax.script.ScriptContext context
           
protected  javax.script.ScriptEngine engine
           
protected  java.lang.String text
           
 
Constructor Summary
ScriptSupport(java.lang.String text, javax.script.ScriptEngine engine)
           
 
Method Summary
 java.lang.Object evaluate()
          evaluate - evaluates the script text relative to the script engine assigned at creation time.
 javax.script.ScriptContext getScriptContext()
          getScriptContext
 javax.script.ScriptEngine getScriptEngine()
          getScriptEngine
 java.lang.String getText()
          getText
 void setText(java.lang.String text)
          setText - set the script text string
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

text

protected java.lang.String text

engine

protected javax.script.ScriptEngine engine

context

protected javax.script.ScriptContext context

compiled

protected javax.script.CompiledScript compiled
Constructor Detail

ScriptSupport

public ScriptSupport(java.lang.String text,
                     javax.script.ScriptEngine engine)
Method Detail

evaluate

public java.lang.Object evaluate()
                          throws javax.script.ScriptException
Description copied from interface: IScript
evaluate - evaluates the script text relative to the script engine assigned at creation time. Will compile the script if the engine is Compilable.

Specified by:
evaluate in interface IScript
Returns:
Throws:
javax.script.ScriptException

getText

public java.lang.String getText()
Description copied from interface: IScript
getText

Specified by:
getText in interface IScript
Returns:
- the script text

setText

public void setText(java.lang.String text)
Description copied from interface: IScript
setText - set the script text string

Specified by:
setText in interface IScript
Parameters:
text - - the script text

getScriptEngine

public javax.script.ScriptEngine getScriptEngine()
Description copied from interface: IScript
getScriptEngine

Specified by:
getScriptEngine in interface IScript
Returns:
- the ScriptEngine for this script, provided at Script creation

getScriptContext

public javax.script.ScriptContext getScriptContext()
Description copied from interface: IScript
getScriptContext

Specified by:
getScriptContext in interface IScript
Returns:
- the ScriptContext for this script. Determined by the ScriptEngine provided when the Script was created.


Copyright © 2004-2008 TELS Center. All Rights Reserved.