org.mozilla.javascript

Class NativeJavaPackage

Implemented Interfaces:
ConstProperties, DebuggableObject, Scriptable, Serializable
Known Direct Subclasses:
NativeJavaTopPackage

public class NativeJavaPackage
extends ScriptableObject

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

Constructor Summary

NativeJavaPackage(String packageName)
Deprecated. NativeJavaPackage is an internal class, do not use it directly.
NativeJavaPackage(String packageName, ClassLoader classLoader)
Deprecated. NativeJavaPackage is an internal class, do not use it directly.

Method Summary

boolean
equals(Object obj)
Object
get(String id, Scriptable start)
Object
get(int index, Scriptable start)
String
getClassName()
Object
getDefaultValue(Class ignored)
boolean
has(String id, Scriptable start)
boolean
has(int index, Scriptable start)
int
hashCode()
void
put(String id, Scriptable start, Object value)
void
put(int index, Scriptable start, Object value)
String
toString()

Methods inherited from class org.mozilla.javascript.ScriptableObject

associateValue, avoidObjectDetection, 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, isGetterOrSetter, isSealed, put, put, putConst, putConstProperty, putProperty, putProperty, redefineProperty, sealObject, setAttributes, setAttributes, setAttributes, setAttributes, setGetterOrSetter, setParentScope, setPrototype

Constructor Details

NativeJavaPackage

public NativeJavaPackage(String packageName)

Deprecated. NativeJavaPackage is an internal class, do not use it directly.


NativeJavaPackage

public NativeJavaPackage(String packageName,
                         ClassLoader classLoader)

Deprecated. NativeJavaPackage is an internal class, do not use it directly.

Method Details

equals

public boolean equals(Object obj)

get

public Object get(String id,
                  Scriptable start)
Specified by:
get in interface Scriptable
Overrides:
get in interface ScriptableObject

get

public Object get(int index,
                  Scriptable start)
Specified by:
get in interface Scriptable
Overrides:
get in interface ScriptableObject

getClassName

public String getClassName()
Specified by:
getClassName in interface Scriptable
Overrides:
getClassName in interface ScriptableObject

getDefaultValue

public Object getDefaultValue(Class ignored)
Specified by:
getDefaultValue in interface Scriptable
Overrides:
getDefaultValue in interface ScriptableObject

has

public boolean has(String id,
                   Scriptable start)
Specified by:
has in interface Scriptable
Overrides:
has in interface ScriptableObject

has

public boolean has(int index,
                   Scriptable start)
Specified by:
has in interface Scriptable
Overrides:
has in interface ScriptableObject

hashCode

public int hashCode()

put

public void put(String id,
                Scriptable start,
                Object value)
Specified by:
put in interface Scriptable
Overrides:
put in interface ScriptableObject

put

public void put(int index,
                Scriptable start,
                Object value)
Specified by:
put in interface Scriptable
Overrides:
put in interface ScriptableObject

toString

public String toString()