ru.biosoft.plugins.javascript
Class Global

java.lang.Object
  extended byorg.mozilla.javascript.ScriptableObject
      extended byorg.mozilla.javascript.ImporterTopLevel
          extended byru.biosoft.plugins.javascript.Global
All Implemented Interfaces:
org.mozilla.javascript.debug.DebuggableObject, org.mozilla.javascript.Scriptable, java.io.Serializable

public class Global
extends org.mozilla.javascript.ImporterTopLevel

See Also:
Serialized Form

Field Summary
protected static org.apache.log4j.Category log
           
static java.lang.String QUIT
           
 
Fields inherited from class org.mozilla.javascript.ScriptableObject
DONTENUM, EMPTY, parent, PERMANENT, prototype, READONLY
 
Fields inherited from interface org.mozilla.javascript.Scriptable
NOT_FOUND
 
Constructor Summary
Global()
           
 
Method Summary
static void defineClass(org.mozilla.javascript.Context cx, org.mozilla.javascript.Scriptable thisObj, java.lang.Object[] args, org.mozilla.javascript.Function funObj)
          Load a Java class that defines a JavaScript object using the conventions outlined in ScriptableObject.defineClass.
static java.lang.Object deserialize(org.mozilla.javascript.Context cx, org.mozilla.javascript.Scriptable thisObj, java.lang.Object[] args, org.mozilla.javascript.Function funObj)
          Restore from the specified file an object previously written by a call to serialize.
static java.lang.Object help(org.mozilla.javascript.Context cx, org.mozilla.javascript.Scriptable thisObj, java.lang.Object[] args, org.mozilla.javascript.Function funObj)
          Returns description for the specified JavaScript function or host object.
static void load(org.mozilla.javascript.Context cx, org.mozilla.javascript.Scriptable thisObj, java.lang.Object[] args, org.mozilla.javascript.Function funObj)
          Load and execute a set of JavaScript source files.
static void loadClass(org.mozilla.javascript.Context cx, org.mozilla.javascript.Scriptable thisObj, java.lang.Object[] args, org.mozilla.javascript.Function funObj)
          Load and execute a script compiled to a class file.
static void print(org.mozilla.javascript.Context cx, org.mozilla.javascript.Scriptable thisObj, java.lang.Object[] args, org.mozilla.javascript.Function funObj)
          Print the string values of its arguments.
static java.lang.String quit()
          Quit the shell.
static void serialize(org.mozilla.javascript.Context cx, org.mozilla.javascript.Scriptable thisObj, java.lang.Object[] args, org.mozilla.javascript.Function funObj)
          Serialize the given object to the specified file.
static double version(org.mozilla.javascript.Context cx, org.mozilla.javascript.Scriptable thisObj, java.lang.Object[] args, org.mozilla.javascript.Function funObj)
          Get and set the language version.
 
Methods inherited from class org.mozilla.javascript.ImporterTopLevel
get, getClassName, has, importClass, importPackage
 
Methods inherited from class org.mozilla.javascript.ScriptableObject
callMethod, defineClass, defineClass, defineFunctionProperties, defineProperty, defineProperty, defineProperty, defineProperty, delete, delete, deleteProperty, deleteProperty, get, getAllIds, getAttributes, getAttributes, getClassPrototype, getDefaultValue, getFunctionPrototype, getIds, getObjectPrototype, getParentScope, getProperty, getProperty, getPropertyIds, getPrototype, getTopLevelScope, has, hasInstance, hasProperty, hasProperty, isSealed, put, put, putProperty, putProperty, sealObject, setAttributes, setAttributes, setParentScope, setPrototype
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

QUIT

public static final java.lang.String QUIT
See Also:
Constant Field Values

log

protected static org.apache.log4j.Category log
Constructor Detail

Global

public Global()
Method Detail

help

public static java.lang.Object help(org.mozilla.javascript.Context cx,
                                    org.mozilla.javascript.Scriptable thisObj,
                                    java.lang.Object[] args,
                                    org.mozilla.javascript.Function funObj)
Returns description for the specified JavaScript function or host object. This description should be loaded using 'ru.biosoft.pligins.javascript.function' or 'ru.biosoft.pligins.javascript.hostObject' extension point.


print

public static void print(org.mozilla.javascript.Context cx,
                         org.mozilla.javascript.Scriptable thisObj,
                         java.lang.Object[] args,
                         org.mozilla.javascript.Function funObj)
Print the string values of its arguments. 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 static java.lang.String quit()
Quit the shell. This only affects the interactive mode.


version

public static double version(org.mozilla.javascript.Context cx,
                             org.mozilla.javascript.Scriptable thisObj,
                             java.lang.Object[] args,
                             org.mozilla.javascript.Function funObj)
Get and set the language version.


load

public static void load(org.mozilla.javascript.Context cx,
                        org.mozilla.javascript.Scriptable thisObj,
                        java.lang.Object[] args,
                        org.mozilla.javascript.Function funObj)
Load and execute a set of JavaScript source files.


defineClass

public static void defineClass(org.mozilla.javascript.Context cx,
                               org.mozilla.javascript.Scriptable thisObj,
                               java.lang.Object[] args,
                               org.mozilla.javascript.Function funObj)
                        throws java.lang.IllegalAccessException,
                               java.lang.InstantiationException,
                               java.lang.reflect.InvocationTargetException,
                               org.mozilla.javascript.ClassDefinitionException,
                               org.mozilla.javascript.PropertyException
Load a Java class that defines a JavaScript object using the conventions outlined in ScriptableObject.defineClass.

Throws:
java.lang.IllegalAccessException - if access is not available to a reflected class member
java.lang.InstantiationException - if unable to instantiate the named class
java.lang.reflect.InvocationTargetException - if an exception is thrown during execution of methods of the named class
org.mozilla.javascript.ClassDefinitionException - if the format of the class causes this exception in ScriptableObject.defineClass
org.mozilla.javascript.PropertyException - if the format of the class causes this exception in ScriptableObject.defineClass
See Also:
ScriptableObject.defineClass(org.mozilla.javascript.Scriptable, java.lang.Class)

loadClass

public static void loadClass(org.mozilla.javascript.Context cx,
                             org.mozilla.javascript.Scriptable thisObj,
                             java.lang.Object[] args,
                             org.mozilla.javascript.Function funObj)
                      throws java.lang.IllegalAccessException,
                             java.lang.InstantiationException,
                             java.lang.reflect.InvocationTargetException,
                             org.mozilla.javascript.JavaScriptException
Load and execute a script compiled to a class file.

When called as a JavaScript function, a single argument is expected. This argument should be the name of a class that implements the Script interface, as will any script compiled by jsc.

Throws:
java.lang.IllegalAccessException - if access is not available to the class
java.lang.InstantiationException - if unable to instantiate the named class
java.lang.reflect.InvocationTargetException - if an exception is thrown during execution of methods of the named class
org.mozilla.javascript.JavaScriptException - if a JavaScript exception is thrown during execution of the compiled script
See Also:
ScriptableObject.defineClass(org.mozilla.javascript.Scriptable, java.lang.Class)

serialize

public static void serialize(org.mozilla.javascript.Context cx,
                             org.mozilla.javascript.Scriptable thisObj,
                             java.lang.Object[] args,
                             org.mozilla.javascript.Function funObj)
                      throws java.io.IOException
Serialize the given object to the specified file.

Throws:
java.io.IOException

deserialize

public static java.lang.Object deserialize(org.mozilla.javascript.Context cx,
                                           org.mozilla.javascript.Scriptable thisObj,
                                           java.lang.Object[] args,
                                           org.mozilla.javascript.Function funObj)
                                    throws java.io.IOException,
                                           java.lang.ClassNotFoundException
Restore from the specified file an object previously written by a call to serialize.

Throws:
java.io.IOException
java.lang.ClassNotFoundException


Copyright © 2001-2003 Biosof.Ru. All Rights Reserved.