|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.script.AbstractScriptEngine
php.java.script.InvocablePhpScriptEngine
php.java.script.CloseableInvocablePhpScriptEngine
public class CloseableInvocablePhpScriptEngine
This class implements the ScriptEngine.
Example:
ScriptEngine e = (new ScriptEngineManager()).getEngineByName("php-invocable");
e.eval(<? function f() {return java_server_name();}?>
System.out.println(((Invocable)e).invokeFunction("f", new Object[]{}));
((Closeable)e).close();
Field Summary |
---|
Fields inherited from interface javax.script.ScriptEngine |
---|
ARGV, ENGINE, ENGINE_VERSION, FILENAME, LANGUAGE, LANGUAGE_VERSION, NAME |
Constructor Summary | |
---|---|
CloseableInvocablePhpScriptEngine()
Create a new ScriptEngine with a default context. |
|
CloseableInvocablePhpScriptEngine(PhpScriptEngineFactory factory)
Create a new ScriptEngine from a factory. |
Method Summary | |
---|---|
void |
close()
Release the script engine. |
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 php.java.script.InvocablePhpScriptEngine |
---|
getInterface, getInterface, invokeFunction, invokeMethod, release |
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 |
Methods inherited from interface java.io.Closeable |
---|
close |
Constructor Detail |
---|
public CloseableInvocablePhpScriptEngine()
public CloseableInvocablePhpScriptEngine(PhpScriptEngineFactory factory)
factory
- The factorygetFactory()
Method Detail |
---|
public java.lang.Object eval(java.io.Reader reader, ScriptContext context) throws ScriptException
ScriptEngine
reader
- the script sourcecontext
- the context contianing different namespace for
script evaluation
ScriptException
- if an error occurspublic java.lang.Object eval(java.lang.String script, ScriptContext context) throws ScriptException
ScriptEngine
script
- the String representation of the scriptcontext
- tbe ScriptContext containing namespaces for the
script evaluation
ScriptException
- if an error occurspublic ScriptEngineFactory getFactory()
ScriptEngine
public Bindings createBindings()
public void close() throws java.io.IOException
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |