Class Main
- java.lang.Object
- 
- org.mozilla.javascript.tools.shell.Main
 
- 
 public class Main extends java.lang.ObjectThe shell program.Can execute scripts interactively or in batch mode at the command line. An example of controlling the JavaScript engine. 
- 
- 
Field SummaryFields Modifier and Type Field Description protected static ToolErrorReportererrorReporterprotected static intexitCodestatic Globalglobalstatic ShellContextFactoryshellContextFactory
 - 
Constructor SummaryConstructors Constructor Description Main()
 - 
Method SummaryAll Methods Static Methods Concrete Methods Modifier and Type Method Description static intexec(java.lang.String[] origArgs)Execute the given arguments, but don't System.exit at the end.static java.io.PrintStreamgetErr()static GlobalgetGlobal()static java.io.InputStreamgetIn()static java.io.PrintStreamgetOut()static voidmain(java.lang.String[] args)Main entry point.static voidprocessFile(Context cx, Scriptable scope, java.lang.String filename)static voidprocessFileNoThrow(Context cx, Scriptable scope, java.lang.String filename)static java.lang.String[]processOptions(java.lang.String[] args)Parse arguments.static voidprocessSource(Context cx, java.lang.String filename)Evaluate JavaScript source.static voidsetErr(java.io.PrintStream err)static voidsetIn(java.io.InputStream in)static voidsetOut(java.io.PrintStream out)
 
- 
- 
- 
Field Detail- 
shellContextFactorypublic static ShellContextFactory shellContextFactory 
 - 
globalpublic static Global global 
 - 
errorReporterprotected static ToolErrorReporter errorReporter 
 - 
exitCodeprotected static int exitCode 
 
- 
 - 
Method Detail- 
mainpublic static void main(java.lang.String[] args) Main entry point.Process arguments as would a normal Java program. Also create a new Context and associate it with the current thread. Then set up the execution environment and begin to execute scripts. 
 - 
execpublic static int exec(java.lang.String[] origArgs) Execute the given arguments, but don't System.exit at the end.
 - 
getGlobalpublic static Global getGlobal() 
 - 
processOptionspublic static java.lang.String[] processOptions(java.lang.String[] args) Parse arguments.
 - 
processSourcepublic static void processSource(Context cx, java.lang.String filename) throws java.io.IOException Evaluate JavaScript source.- Parameters:
- cx- the current context
- filename- the name of the file to compile, or null for interactive mode.
- Throws:
- java.io.IOException- if the source could not be read
- RhinoException- thrown during evaluation of source
 
 - 
processFileNoThrowpublic static void processFileNoThrow(Context cx, Scriptable scope, java.lang.String filename) 
 - 
processFilepublic static void processFile(Context cx, Scriptable scope, java.lang.String filename) throws java.io.IOException - Throws:
- java.io.IOException
 
 - 
getInpublic static java.io.InputStream getIn() 
 - 
setInpublic static void setIn(java.io.InputStream in) 
 - 
getOutpublic static java.io.PrintStream getOut() 
 - 
setOutpublic static void setOut(java.io.PrintStream out) 
 - 
getErrpublic static java.io.PrintStream getErr() 
 - 
setErrpublic static void setErr(java.io.PrintStream err) 
 
- 
 
-