Class SlingGlobal

  • All Implemented Interfaces:
    java.io.Serializable, org.mozilla.javascript.IdFunctionCall

    public class SlingGlobal
    extends java.lang.Object
    implements java.io.Serializable, org.mozilla.javascript.IdFunctionCall
    The SlingGlobal class provides two interesting new global functions which are not part of the ECMAScript standard but which are available in the Rhino Shell and which may be of use by JavaScripts:
    print(args, ...)
    Prints the arguments args in a single message to the scripts logger available as the global log variable.
    load(args, ...)
    Loads the scripts named as parameters into the current scope one, after the other. Usually the script files are read as plain JavaScript files. If the file extension happens to be .esp to indicate an ECMAScript Server Page, the file is read through an EspReader. Failure to read one of the files throws an error.
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      SlingGlobal()  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Object execIdCall​(org.mozilla.javascript.IdFunctionObject f, org.mozilla.javascript.Context cx, org.mozilla.javascript.Scriptable scope, org.mozilla.javascript.Scriptable thisObj, java.lang.Object[] args)  
      static void init​(org.mozilla.javascript.Scriptable scope, boolean sealed)  
      java.lang.Object require​(org.mozilla.javascript.Context cx, org.mozilla.javascript.Scriptable thisObj, java.lang.Object[] args)  
      • Methods inherited from class java.lang.Object

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

      • SlingGlobal

        public SlingGlobal()
    • Method Detail

      • init

        public static void init​(org.mozilla.javascript.Scriptable scope,
                                boolean sealed)
      • execIdCall

        public java.lang.Object execIdCall​(org.mozilla.javascript.IdFunctionObject f,
                                           org.mozilla.javascript.Context cx,
                                           org.mozilla.javascript.Scriptable scope,
                                           org.mozilla.javascript.Scriptable thisObj,
                                           java.lang.Object[] args)
        Specified by:
        execIdCall in interface org.mozilla.javascript.IdFunctionCall
      • require

        public java.lang.Object require​(org.mozilla.javascript.Context cx,
                                        org.mozilla.javascript.Scriptable thisObj,
                                        java.lang.Object[] args)