php.java.faces
Class PhpFacesScriptEngine
java.lang.Object
javax.script.AbstractScriptEngine
php.java.script.InvocablePhpScriptEngine
php.java.faces.PhpFacesScriptEngine
- All Implemented Interfaces:
- Invocable, ScriptEngine
public class PhpFacesScriptEngine
- extends InvocablePhpScriptEngine
- implements Invocable
A custom ScriptEngine, keeps the custom ScriptContext
- Author:
- jostb
|
Constructor Summary |
PhpFacesScriptEngine(javax.servlet.ServletContext ctx,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
PhpScriptWriter writer)
Creates a new ScriptEngine. |
|
Method Summary |
Bindings |
createBindings()
Retrieves an uninitailized namespace which can be used as the scope of
the ScriptEngine. |
java.lang.Object |
eval(java.io.Reader reader,
ScriptContext context)
Evaluates a script obtained using the specified reader as the
script source and using the namespaces in the specifed
ScriptContext. |
java.lang.Object |
eval(java.lang.String script,
ScriptContext context)
Evaluates a script using the namespaces in the specifed
ScriptContext. |
ScriptEngineFactory |
getFactory()
Retrieves a ScriptEngineFactory for the class to which
describes the underlying ScriptEngine. |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PhpFacesScriptEngine
public PhpFacesScriptEngine(javax.servlet.ServletContext ctx,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
PhpScriptWriter writer)
- Creates a new ScriptEngine.
- Parameters:
ctx - The ServletContextrequest - The HttpServletRequestresponse - The HttpServletResponsewriter - The PhpScriptWriter
eval
public java.lang.Object eval(java.io.Reader reader,
ScriptContext context)
throws ScriptException
- Description copied from interface:
ScriptEngine
- Evaluates a script obtained using the specified reader as the
script source and using the namespaces in the specifed
ScriptContext. Returns null for non-returning scripts
- Parameters:
reader - the script sourcecontext - the context contianing different namespace for
script evaluation
- Returns:
- the value of the evaluated script
- Throws:
ScriptException - if an error occurs
eval
public java.lang.Object eval(java.lang.String script,
ScriptContext context)
throws ScriptException
- Description copied from interface:
ScriptEngine
- Evaluates a script using the namespaces in the specifed
ScriptContext. Return null for non-returning scripts.
- Parameters:
script - the String representation of the scriptcontext - tbe ScriptContext containing namespaces for the
script evaluation
- Returns:
- the value of the evaluated script
- Throws:
ScriptException - if an error occurs
getFactory
public ScriptEngineFactory getFactory()
- Description copied from interface:
ScriptEngine
- Retrieves a ScriptEngineFactory for the class to which
describes the underlying ScriptEngine.
- Returns:
- an instance of ScriptEngineFactory which describes the
underlying ScriptEngine
createBindings
public Bindings createBindings()
- Retrieves an uninitailized namespace which can be used as the scope of
the ScriptEngine.
- Returns:
- an initialzed namespace which can be used to repalce the state
of the ScriptEngine