org.oddjob.script
Class PreCompiled

java.lang.Object
  extended by org.oddjob.script.PreCompiled
All Implemented Interfaces:
Evaluatable

public class PreCompiled
extends Object
implements Evaluatable

Provide an Evaluatable for a CompiledScript.

Author:
rob

Constructor Summary
PreCompiled(ScriptEngine engine, CompiledScript compiled)
           
 
Method Summary
 Object eval()
          Evaluate the evaluatable.
 Object get(String key)
          Get a bean from the engines bindings.
 void put(String key, Object value)
          Add a bean
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PreCompiled

public PreCompiled(ScriptEngine engine,
                   CompiledScript compiled)
Method Detail

eval

public Object eval()
            throws ScriptException
Description copied from interface: Evaluatable
Evaluate the evaluatable.

Specified by:
eval in interface Evaluatable
Returns:
The object returned by the script or null if the script does not return a value.
Throws:
ScriptException

get

public Object get(String key)
Description copied from interface: Evaluatable
Get a bean from the engines bindings.

Specified by:
get in interface Evaluatable
Parameters:
key - The scripts variable name.
Returns:
The bean if one of the name exists.

put

public void put(String key,
                Object value)
Description copied from interface: Evaluatable
Add a bean

Specified by:
put in interface Evaluatable