org.mozilla.javascript

Class NativeJavaTopPackage

Implemented Interfaces:
Callable, ConstProperties, DebuggableObject, Function, IdFunctionCall, Scriptable, Serializable

public class NativeJavaTopPackage
extends NativeJavaPackage
implements Function, IdFunctionCall

This class reflects Java packages into the JavaScript environment. We lazily reflect classes and subpackages, and use a caching/sharing system to ensure that members reflected into one JavaPackage appear in all other references to the same package (as with Packages.java.lang and java.lang).
Author:
Mike Shaver
See Also:
NativeJavaArray, NativeJavaObject, NativeJavaClass

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

Method Summary

Object
call(Context cx, Scriptable scope, Scriptable thisObj, Object[] args)
Scriptable
construct(Context cx, Scriptable scope, Object[] args)
Object
execIdCall(IdFunctionObject f, Context cx, Scriptable scope, Scriptable thisObj, Object[] args)
'thisObj' will be null if invoked as constructor, in which case instance of Scriptable should be returned
static void
init(Context cx, Scriptable scope, boolean sealed)

Methods inherited from class org.mozilla.javascript.NativeJavaPackage

equals, get, get, getClassName, getDefaultValue, has, has, hashCode, put, put, toString

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, getClassName, 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

Method Details

call

public Object call(Context cx,
                   Scriptable scope,
                   Scriptable thisObj,
                   Object[] args)
Specified by:
call in interface Function
call in interface Callable

construct

public Scriptable construct(Context cx,
                            Scriptable scope,
                            Object[] args)
Specified by:
construct in interface Function

execIdCall

public Object execIdCall(IdFunctionObject f,
                         Context cx,
                         Scriptable scope,
                         Scriptable thisObj,
                         Object[] args)
'thisObj' will be null if invoked as constructor, in which case instance of Scriptable should be returned
Specified by:
execIdCall in interface IdFunctionCall

init

public static void init(Context cx,
                        Scriptable scope,
                        boolean sealed)