Class SlingGlobal
- java.lang.Object
-
- org.apache.sling.scripting.javascript.helper.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.IdFunctionCallTheSlingGlobalclass 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
argsin 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.ObjectexecIdCall(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 voidinit(org.mozilla.javascript.Scriptable scope, boolean sealed)java.lang.Objectrequire(org.mozilla.javascript.Context cx, org.mozilla.javascript.Scriptable thisObj, java.lang.Object[] args)
-
-
-
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:
execIdCallin interfaceorg.mozilla.javascript.IdFunctionCall
-
require
public java.lang.Object require(org.mozilla.javascript.Context cx, org.mozilla.javascript.Scriptable thisObj, java.lang.Object[] args)
-
-