net_alchim31_maven_yuicompressor
Class BasicRhinoShell

java.lang.Object
  extended by org.mozilla.javascript.ScriptableObject
      extended by net_alchim31_maven_yuicompressor.BasicRhinoShell
All Implemented Interfaces:
Serializable, org.mozilla.javascript.ConstProperties, org.mozilla.javascript.debug.DebuggableObject, org.mozilla.javascript.Scriptable

public class BasicRhinoShell
extends org.mozilla.javascript.ScriptableObject

The BasicRhinoShell program. Can execute scripts interactively or in batch mode at the command line. An example of controlling the JavaScript engine.

Author:
Norris Boyd
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.mozilla.javascript.ScriptableObject
CONST, DONTENUM, EMPTY, PERMANENT, READONLY, UNINITIALIZED_CONST
 
Fields inherited from interface org.mozilla.javascript.Scriptable
NOT_FOUND
 
Constructor Summary
BasicRhinoShell()
           
 
Method Summary
static void exec(String[] args, org.mozilla.javascript.ErrorReporter reporter)
          Main entry point.
 String getClassName()
           
 void help()
          Print a help message.
static void load(org.mozilla.javascript.Context cx, org.mozilla.javascript.Scriptable thisObj, Object[] args, org.mozilla.javascript.Function funObj)
          Load and execute a set of JavaScript source files.
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 String[] processOptions(org.mozilla.javascript.Context cx, String[] args)
          Parse arguments.
 void quit()
          Quit the BasicRhinoShell.
 String readFile(String path)
          This method is defined as a JavaScript function.
static double version(org.mozilla.javascript.Context cx, org.mozilla.javascript.Scriptable thisObj, Object[] args, org.mozilla.javascript.Function funObj)
          Get and set the language version.
static void warn(org.mozilla.javascript.Context cx, org.mozilla.javascript.Scriptable thisObj, Object[] args, org.mozilla.javascript.Function funObj)
           
 
Methods inherited from class org.mozilla.javascript.ScriptableObject
associateValue, callMethod, callMethod, defineClass, defineClass, defineClass, defineConst, defineConstProperty, defineFunctionProperties, defineProperty, defineProperty, defineProperty, defineProperty, delete, delete, deleteProperty, deleteProperty, equivalentValues, get, get, getAllIds, getAssociatedValue, getAttributes, getAttributes, getAttributes, getAttributes, getClassPrototype, getDefaultValue, getDefaultValue, getFunctionPrototype, getGetterOrSetter, getIds, getObjectPrototype, getParentScope, getProperty, getProperty, getPropertyIds, getPrototype, getTopLevelScope, getTopScopeValue, has, has, hasInstance, hasProperty, hasProperty, isConst, isSealed, put, put, putConst, putConstProperty, putProperty, putProperty, redefineProperty, sealObject, setAttributes, setAttributes, setAttributes, setAttributes, setGetterOrSetter, setParentScope, setPrototype
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BasicRhinoShell

public BasicRhinoShell()
Method Detail

getClassName

public String getClassName()
Specified by:
getClassName in interface org.mozilla.javascript.Scriptable
Specified by:
getClassName in class org.mozilla.javascript.ScriptableObject

exec

public static void exec(String[] args,
                        org.mozilla.javascript.ErrorReporter reporter)
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.


processOptions

public static String[] processOptions(org.mozilla.javascript.Context cx,
                                      String[] args)
Parse arguments.


help

public void help()
Print a help message. This method is defined as a JavaScript function.


print

public 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. This method is defined as a JavaScript function. Note that its arguments are of the "varargs" form, which allows it to handle an arbitrary number of arguments supplied to the JavaScript function.


quit

public void quit()
Quit the BasicRhinoShell. This only affects the interactive mode. This method is defined as a JavaScript function.


warn

public static void warn(org.mozilla.javascript.Context cx,
                        org.mozilla.javascript.Scriptable thisObj,
                        Object[] args,
                        org.mozilla.javascript.Function funObj)

readFile

public String readFile(String path)
This method is defined as a JavaScript function.


version

public static double version(org.mozilla.javascript.Context cx,
                             org.mozilla.javascript.Scriptable thisObj,
                             Object[] args,
                             org.mozilla.javascript.Function funObj)
Get and set the language version. This method is defined as a JavaScript function.


load

public static void load(org.mozilla.javascript.Context cx,
                        org.mozilla.javascript.Scriptable thisObj,
                        Object[] args,
                        org.mozilla.javascript.Function funObj)
Load and execute a set of JavaScript source files. This method is defined as a JavaScript function.



Copyright © 2010-2012 Alchim31. All Rights Reserved.