|
|||||||||
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.NativeJavaPackage
public class NativeJavaPackage
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).
NativeJavaArray
,
NativeJavaObject
,
NativeJavaClass
,
Serialized FormField 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(java.lang.String packageName)
Deprecated. NativeJavaPackage is an internal class, do not use it directly. |
|
NativeJavaPackage(java.lang.String packageName,
java.lang.ClassLoader classLoader)
Deprecated. NativeJavaPackage is an internal class, do not use it directly. |
Method Summary | |
---|---|
boolean |
equals(java.lang.Object obj)
|
java.lang.Object |
get(int index,
Scriptable start)
Returns the value of the indexed property or NOT_FOUND. |
java.lang.Object |
get(java.lang.String id,
Scriptable start)
Returns the value of the named property or NOT_FOUND. |
java.lang.String |
getClassName()
Return the name of the class. |
java.lang.Object |
getDefaultValue(java.lang.Class<?> ignored)
Implements the [[DefaultValue]] internal method. |
boolean |
has(int index,
Scriptable start)
Returns true if the property index is defined. |
boolean |
has(java.lang.String id,
Scriptable start)
Returns true if the named property is defined. |
int |
hashCode()
|
void |
put(int index,
Scriptable start,
java.lang.Object value)
Sets the value of the indexed property, creating it if need be. |
void |
put(java.lang.String id,
Scriptable start,
java.lang.Object value)
Sets the value of the named property, creating it if need be. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public NativeJavaPackage(java.lang.String packageName, java.lang.ClassLoader classLoader)
public NativeJavaPackage(java.lang.String packageName)
Method Detail |
---|
public java.lang.String getClassName()
ScriptableObject
getClassName
in interface Scriptable
getClassName
in class ScriptableObject
public boolean has(java.lang.String id, Scriptable start)
ScriptableObject
has
in interface Scriptable
has
in class ScriptableObject
id
- the name of the propertystart
- the object in which the lookup began
Scriptable.get(String, Scriptable)
,
ScriptableObject.getProperty(Scriptable, String)
public boolean has(int index, Scriptable start)
ScriptableObject
has
in interface Scriptable
has
in class ScriptableObject
index
- the numeric index for the propertystart
- the object in which the lookup began
Scriptable.get(int, Scriptable)
,
ScriptableObject.getProperty(Scriptable, int)
public void put(java.lang.String id, Scriptable start, java.lang.Object value)
ScriptableObject
If the property's attributes include READONLY, no action is taken. This method will actually set the property in the start object.
put
in interface Scriptable
put
in class ScriptableObject
id
- the name of the propertystart
- the object whose property is being setvalue
- value to set the property toScriptable.has(String, Scriptable)
,
Scriptable.get(String, Scriptable)
,
ScriptableObject.putProperty(Scriptable, String, Object)
,
Context.toObject(Object, Scriptable)
public void put(int index, Scriptable start, java.lang.Object value)
ScriptableObject
put
in interface Scriptable
put
in class ScriptableObject
index
- the numeric index for the propertystart
- the object whose property is being setvalue
- value to set the property toScriptable.has(int, Scriptable)
,
Scriptable.get(int, Scriptable)
,
ScriptableObject.putProperty(Scriptable, int, Object)
,
Context.toObject(Object, Scriptable)
public java.lang.Object get(java.lang.String id, Scriptable start)
ScriptableObject
get
in interface Scriptable
get
in class ScriptableObject
id
- the name of the propertystart
- the object in which the lookup began
Context.getUndefinedValue()
public java.lang.Object get(int index, Scriptable start)
ScriptableObject
get
in interface Scriptable
get
in class ScriptableObject
index
- the numeric index for the propertystart
- the object in which the lookup began
Scriptable.get(String,Scriptable)
public java.lang.Object getDefaultValue(java.lang.Class<?> ignored)
ScriptableObject
Note that the toPrimitive conversion is a no-op for every type other than Object, for which [[DefaultValue]] is called. See ECMA 9.1.
A hint
of null means "no hint".
getDefaultValue
in interface Scriptable
getDefaultValue
in class ScriptableObject
ignored
- the type hint
public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |