public class GlobalFunctions extends Object
Constructor and Description |
---|
GlobalFunctions() |
Modifier and Type | Method and Description |
---|---|
static org.mozilla.javascript.Scriptable |
createPseudoFileSystemScope(org.mozilla.javascript.tools.shell.Global global,
org.mozilla.javascript.Context context) |
static void |
debug(org.mozilla.javascript.Context cx,
org.mozilla.javascript.Scriptable thisObj,
Object[] args,
org.mozilla.javascript.Function funObj)
Print the string values of its arguments.
|
static Object |
get(org.mozilla.javascript.Scriptable scope,
String name) |
static Integer |
getExitCode() |
static void |
print(org.mozilla.javascript.Context cx,
org.mozilla.javascript.Scriptable thisObj,
Object[] args,
org.mozilla.javascript.Function funObj)
Print the string values of its arguments.
|
static void |
quit(org.mozilla.javascript.Context cx,
org.mozilla.javascript.Scriptable thisObj,
Object[] args,
org.mozilla.javascript.Function funObj)
Print the string values of its arguments.
|
static Object |
readFile(org.mozilla.javascript.Context cx,
org.mozilla.javascript.Scriptable thisObj,
Object[] args,
org.mozilla.javascript.Function funObj)
The readFile reads the given file content and convert it to a string
using the specified character coding or default character coding if
explicit coding argument is not given.
|
static void |
setExitCode(int exitCode) |
static void |
warn(org.mozilla.javascript.Context cx,
org.mozilla.javascript.Scriptable thisObj,
Object[] args,
org.mozilla.javascript.Function funObj)
Print the string values of its arguments.
|
public GlobalFunctions()
public static void print(org.mozilla.javascript.Context cx, org.mozilla.javascript.Scriptable thisObj, Object[] args, org.mozilla.javascript.Function funObj)
public static void debug(org.mozilla.javascript.Context cx, org.mozilla.javascript.Scriptable thisObj, Object[] args, org.mozilla.javascript.Function funObj)
public static void warn(org.mozilla.javascript.Context cx, org.mozilla.javascript.Scriptable thisObj, Object[] args, org.mozilla.javascript.Function funObj)
public static void quit(org.mozilla.javascript.Context cx, org.mozilla.javascript.Scriptable thisObj, Object[] args, org.mozilla.javascript.Function funObj)
public static Object readFile(org.mozilla.javascript.Context cx, org.mozilla.javascript.Scriptable thisObj, Object[] args, org.mozilla.javascript.Function funObj) throws IOException
Usage:
readFile(filePath) readFile(filePath, charCoding)The first form converts file's context to string using the default character coding.
IOException
public static void setExitCode(int exitCode)
public static Integer getExitCode()
public static org.mozilla.javascript.Scriptable createPseudoFileSystemScope(org.mozilla.javascript.tools.shell.Global global, org.mozilla.javascript.Context context)
Copyright © 2012-2013. All Rights Reserved.