|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.mozilla.javascript.ScriptableObject org.mozilla.javascript.IdScriptableObject org.mozilla.javascript.ImporterTopLevel
public class ImporterTopLevel
Class ImporterTopLevel This class defines a ScriptableObject that can be instantiated as a top-level ("global") object to provide functionality similar to Java's "import" statement.
This class can be used to create a top-level scope using the following code:
Scriptable scope = new ImporterTopLevel(cx);Then JavaScript code will have access to the following methods:
js> importClass(java.io.File) js> f = new File('help.txt') help.txt js> importPackage(java.util) js> v = new Vector() []
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 | |
---|---|
ImporterTopLevel()
|
|
ImporterTopLevel(Context cx)
|
|
ImporterTopLevel(Context cx,
boolean sealed)
|
Method Summary | |
---|---|
java.lang.Object |
execIdCall(org.mozilla.javascript.IdFunctionObject f,
Context cx,
Scriptable scope,
Scriptable thisObj,
java.lang.Object[] args)
'thisObj' will be null if invoked as constructor, in which case instance of Scriptable should be returned. |
protected int |
findPrototypeId(java.lang.String s)
|
java.lang.Object |
get(java.lang.String name,
Scriptable start)
Returns the value of the named property or NOT_FOUND. |
java.lang.String |
getClassName()
Return the name of the class. |
boolean |
has(java.lang.String name,
Scriptable start)
Returns true if the named property is defined. |
void |
importPackage(Context cx,
Scriptable thisObj,
java.lang.Object[] args,
Function funObj)
Deprecated. Kept only for compatibility. |
static void |
init(Context cx,
Scriptable scope,
boolean sealed)
|
protected void |
initPrototypeId(int id)
|
void |
initStandardObjects(Context cx,
boolean sealed)
|
Methods inherited from class org.mozilla.javascript.IdScriptableObject |
---|
activatePrototypeMap, addIdFunctionProperty, defaultGet, defaultPut, delete, exportAsJSClass, fillConstructorProperties, findInstanceIdInfo, getAttributes, getInstanceIdName, getInstanceIdValue, getMaxInstanceId, hasPrototypeMap, incompatibleCallError, initPrototypeConstructor, initPrototypeMethod, initPrototypeValue, instanceIdInfo, put, setAttributes, setInstanceIdValue |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ImporterTopLevel()
public ImporterTopLevel(Context cx)
public ImporterTopLevel(Context cx, boolean sealed)
Method Detail |
---|
public java.lang.String getClassName()
ScriptableObject
getClassName
in interface Scriptable
getClassName
in class ScriptableObject
public static void init(Context cx, Scriptable scope, boolean sealed)
public void initStandardObjects(Context cx, boolean sealed)
public boolean has(java.lang.String name, Scriptable start)
ScriptableObject
has
in interface Scriptable
has
in class org.mozilla.javascript.IdScriptableObject
name
- the name of the propertystart
- the object in which the lookup began
Scriptable.get(String, Scriptable)
,
ScriptableObject.getProperty(Scriptable, String)
public java.lang.Object get(java.lang.String name, Scriptable start)
ScriptableObject
get
in interface Scriptable
get
in class org.mozilla.javascript.IdScriptableObject
name
- the name of the propertystart
- the object in which the lookup began
Context.getUndefinedValue()
public void importPackage(Context cx, Scriptable thisObj, java.lang.Object[] args, Function funObj)
protected void initPrototypeId(int id)
initPrototypeId
in class org.mozilla.javascript.IdScriptableObject
public java.lang.Object execIdCall(org.mozilla.javascript.IdFunctionObject f, Context cx, Scriptable scope, Scriptable thisObj, java.lang.Object[] args)
org.mozilla.javascript.IdScriptableObject
execIdCall
in interface org.mozilla.javascript.IdFunctionCall
execIdCall
in class org.mozilla.javascript.IdScriptableObject
protected int findPrototypeId(java.lang.String s)
findPrototypeId
in class org.mozilla.javascript.IdScriptableObject
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |