php.java.script
Class InteractivePhpScriptEngine

java.lang.Object
  extended by javax.script.AbstractScriptEngine
      extended by php.java.script.SimplePhpScriptEngine
          extended by php.java.script.InvocablePhpScriptEngine
              extended by php.java.script.InteractivePhpScriptEngine
All Implemented Interfaces:
java.io.Closeable, Invocable, ScriptEngine

public class InteractivePhpScriptEngine
extends InvocablePhpScriptEngine

A convenience variant of the PHP script engine which can be used interactively.

Example:

ScriptEngine e = (new ScriptEngineManager()).getEngineByName("php-interactive);
e.eval("$v = 1+2");
System.out.println(e.eval("echo $v"));
e.eval((String)null);

Author:
jostb

Field Summary
 
Fields inherited from interface javax.script.ScriptEngine
ARGV, ENGINE, ENGINE_VERSION, FILENAME, LANGUAGE, LANGUAGE_VERSION, NAME
 
Constructor Summary
InteractivePhpScriptEngine(InteractivePhpScriptEngineFactory factory)
          Create the interactive php script engine.
 
Method Summary
 java.lang.Object eval(java.lang.String script, ScriptContext context)
          Create the interactive php script engine.
 void release()
          Release the continuation
 
Methods inherited from class php.java.script.InvocablePhpScriptEngine
getInterface, getInterface, invoke, invoke, invokeFunction, invokeMethod
 
Methods inherited from class php.java.script.SimplePhpScriptEngine
close, createBindings, eval, getFactory
 
Methods inherited from class javax.script.AbstractScriptEngine
eval, eval, eval, eval, get, getBindings, getContext, put, setBindings, setContext
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InteractivePhpScriptEngine

public InteractivePhpScriptEngine(InteractivePhpScriptEngineFactory factory)
Create the interactive php script engine.

Method Detail

eval

public java.lang.Object eval(java.lang.String script,
                             ScriptContext context)
                      throws ScriptException
Create the interactive php script engine.

Specified by:
eval in interface ScriptEngine
Overrides:
eval in class SimplePhpScriptEngine
Parameters:
script - the String representation of the script
context - tbe ScriptContext containing namespaces for the script evaluation
Returns:
the value of the evaluated script
Throws:
ScriptException - if an error occurs

release

public void release()
Description copied from class: SimplePhpScriptEngine
Release the continuation

Overrides:
release in class InvocablePhpScriptEngine