Class RhinoJavaScriptEngine

  • All Implemented Interfaces:
    javax.script.Compilable, javax.script.ScriptEngine

    public class RhinoJavaScriptEngine
    extends org.apache.sling.scripting.api.AbstractSlingScriptEngine
    implements javax.script.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​(javax.script.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
      javax.script.CompiledScript compile​(java.io.Reader scriptReader)  
      javax.script.CompiledScript compile​(java.lang.String script)  
      java.lang.Object eval​(java.io.Reader scriptReader, javax.script.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
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • RhinoJavaScriptEngine

        public RhinoJavaScriptEngine​(javax.script.ScriptEngineFactory factory,
                                     org.mozilla.javascript.Scriptable rootScope,
                                     org.apache.sling.scripting.api.ScriptCache scriptCache)
    • Method Detail

      • compile

        public javax.script.CompiledScript compile​(java.lang.String script)
                                            throws javax.script.ScriptException
        Specified by:
        compile in interface javax.script.Compilable
        Throws:
        javax.script.ScriptException
      • compile

        public javax.script.CompiledScript compile​(java.io.Reader scriptReader)
                                            throws javax.script.ScriptException
        Specified by:
        compile in interface javax.script.Compilable
        Throws:
        javax.script.ScriptException
      • eval

        public java.lang.Object eval​(java.io.Reader scriptReader,
                                     javax.script.ScriptContext scriptContext)
                              throws javax.script.ScriptException
        Specified by:
        eval in interface javax.script.ScriptEngine
        Throws:
        javax.script.ScriptException