Overview | Package | Class | Use | Tree | Help
| HEADER
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## ru.biosoft.plugins.javascript
Class Global

    |
    +--ru.biosoft.plugins.javascript.Global

public class Global
extends ImporterTopLevel

Field Summary
`final static String` | `QUIT`

Constructor Summary
`Global()`

Method Summary
`static void` | `defineClass(Context cx, Scriptable thisObj, Object[] args, Function funObj)` Load a Java class that defines a JavaScript object using the conventions outlined in ScriptableObject.defineClass.
`static Object` | `deserialize(Context cx, Scriptable thisObj, Object[] args, Function funObj)` Restore from the specified file an object previously written by a call to serialize.
`static Object` | `help(Context cx, Scriptable thisObj, Object[] args, Function funObj)` Returns description for the specified JavaScript function or host object.
`static void` | `load(Context cx, Scriptable thisObj, Object[] args, Function funObj)` Load and execute a set of JavaScript source files.
`static void` | `loadClass(Context cx, Scriptable thisObj, Object[] args, Function funObj)` Load and execute a script compiled to a class file.
`static void` | `print(Context cx, Scriptable thisObj, Object[] args, Function funObj)` Print the string values of its arguments.
`static String` | `quit()` Quit the shell.
`static void` | `serialize(Context cx, Scriptable thisObj, Object[] args, Function funObj)` Serialize the given object to the specified file.
`static double` | `version(Context cx, Scriptable thisObj, Object[] args, Function funObj)` Get and set the language version.

Field Detail

### QUIT

    public final static String QUIT

Constructor Detail

### Global

    public Global()

Method Detail

### defineClass

    public static void defineClass(Context cx, Scriptable thisObj, Object[] args, Function funObj)
                             throws java.lang.IllegalAccessException,
                                    java.lang.InstantiationException,
                                    java.lang.reflect.InvocationTargetException,
                                    ClassDefinitionException,
                                    PropertyException

  Load a Java class that defines a JavaScript object using the conventions outlined in ScriptableObject.defineClass.
  Throws:
    IllegalAccessException - if access is not available to a reflected class member
    InstantiationException - if unable to instantiate the named class
    InvocationTargetException - if an exception is thrown during execution of methods of the named class
    ClassDefinitionException - if the format of the class causes this exception in ScriptableObject.defineClass
    PropertyException - if the format of the class causes this exception in ScriptableObject.defineClass
  See Also:
    org.mozilla.javascript.ScriptableObject#defineClass

### deserialize

    public static Object deserialize(Context cx, Scriptable thisObj, Object[] args, Function funObj)
                               throws java.io.IOException,
                                      java.lang.ClassNotFoundException

  Restore from the specified file an object previously written by a call to serialize.

### help

    public static Object help(Context cx, Scriptable thisObj, Object[] args, 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.

### load

    public static void load(Context cx, Scriptable thisObj, Object[] args, Function funObj)

  Load and execute a set of JavaScript source files.

### loadClass

    public static void loadClass(Context cx, Scriptable thisObj, Object[] args, Function funObj)
                           throws java.lang.IllegalAccessException,
                                  java.lang.InstantiationException,
                                  java.lang.reflect.InvocationTargetException,
                                  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:
    IllegalAccessException - if access is not available to the class
    InstantiationException - if unable to instantiate the named class
    InvocationTargetException - if an exception is thrown during execution of methods of the named class
    JavaScriptException - if a JavaScript exception is thrown during execution of the compiled script
  See Also:
    org.mozilla.javascript.ScriptableObject#defineClass

### print

    public static void print(Context cx, Scriptable thisObj, Object[] args, 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 String quit()

  Quit the shell. This only affects the interactive mode.

### serialize

    public static void serialize(Context cx, Scriptable thisObj, Object[] args, Function funObj)
                           throws java.io.IOException

  Serialize the given object to the specified file.

### version

    public static double version(Context cx, Scriptable thisObj, Object[] args, Function funObj)

  Get and set the language version.

Association Links

to Class java.lang.String

to Class org.apache.log4j.Category

Overview | Package | Class | Use | Tree | Help
| FOOTER
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

BOTTOM