Class RhinoJavaScriptEngine
- java.lang.Object
-
- javax.script.AbstractScriptEngine
-
- org.apache.sling.scripting.api.AbstractSlingScriptEngine
-
- org.apache.sling.scripting.javascript.internal.RhinoJavaScriptEngine
-
- All Implemented Interfaces:
Compilable
,ScriptEngine
public class RhinoJavaScriptEngine extends org.apache.sling.scripting.api.AbstractSlingScriptEngine implements Compilable
A ScriptEngine that uses the Rhino interpreter to process Sling requests with server-side javascript.
-
-
Field Summary
-
Fields inherited from class javax.script.AbstractScriptEngine
context
-
Fields inherited from interface javax.script.ScriptEngine
ARGV, ENGINE, ENGINE_VERSION, FILENAME, LANGUAGE, LANGUAGE_VERSION, NAME
-
-
Constructor Summary
Constructors Constructor Description RhinoJavaScriptEngine(ScriptEngineFactory factory, org.mozilla.javascript.Scriptable rootScope, org.apache.sling.scripting.api.ScriptCache scriptCache)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CompiledScript
compile(Reader scriptReader)
CompiledScript
compile(String script)
Object
eval(Reader scriptReader, ScriptContext scriptContext)
-
Methods inherited from class org.apache.sling.scripting.api.AbstractSlingScriptEngine
createBindings, eval, getFactory
-
Methods inherited from class javax.script.AbstractScriptEngine
eval, eval, eval, eval, get, getBindings, getContext, getScriptContext, put, setBindings, setContext
-
-
-
-
Constructor Detail
-
RhinoJavaScriptEngine
public RhinoJavaScriptEngine(ScriptEngineFactory factory, org.mozilla.javascript.Scriptable rootScope, org.apache.sling.scripting.api.ScriptCache scriptCache)
-
-
Method Detail
-
compile
public CompiledScript compile(String script) throws ScriptException
- Specified by:
compile
in interfaceCompilable
- Throws:
ScriptException
-
compile
public CompiledScript compile(Reader scriptReader) throws ScriptException
- Specified by:
compile
in interfaceCompilable
- Throws:
ScriptException
-
eval
public Object eval(Reader scriptReader, ScriptContext scriptContext) throws ScriptException
- Specified by:
eval
in interfaceScriptEngine
- Throws:
ScriptException
-
-