org.mozilla.javascript

Class NativeJavaArray

Implemented Interfaces:
Scriptable, Serializable, Wrapper

public class NativeJavaArray
extends NativeJavaObject

This class reflects Java arrays into the JavaScript environment.
Author:
Mike Shaver
See Also:
NativeJavaClass, NativeJavaObject, NativeJavaPackage

Field Summary

Fields inherited from class org.mozilla.javascript.NativeJavaObject

javaObject, members, parent, prototype, staticType

Fields inherited from interface org.mozilla.javascript.Scriptable

NOT_FOUND

Constructor Summary

NativeJavaArray(Scriptable scope, Object array)

Method Summary

Object
get(String id, Scriptable start)
Object
get(int index, Scriptable start)
String
getClassName()
Object
getDefaultValue(Class hint)
Object[]
getIds()
Scriptable
getPrototype()
boolean
has(String id, Scriptable start)
boolean
has(int index, Scriptable start)
boolean
hasInstance(Scriptable value)
void
put(String id, Scriptable start, Object value)
void
put(int index, Scriptable start, Object value)
Object
unwrap()
static NativeJavaArray
wrap(Scriptable scope, Object array)

Methods inherited from class org.mozilla.javascript.NativeJavaObject

canConvert, coerceType, delete, delete, get, get, getClassName, getDefaultValue, getIds, getParentScope, getPrototype, has, has, hasInstance, initMembers, put, put, setParentScope, setPrototype, unwrap, wrap

Constructor Details

NativeJavaArray

public NativeJavaArray(Scriptable scope,
                       Object array)

Method Details

get

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

get

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

getClassName

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

getDefaultValue

public Object getDefaultValue(Class hint)
Specified by:
getDefaultValue in interface Scriptable
Overrides:
getDefaultValue in interface NativeJavaObject

getIds

public Object[] getIds()
Specified by:
getIds in interface Scriptable
Overrides:
getIds in interface NativeJavaObject

getPrototype

public Scriptable getPrototype()
Specified by:
getPrototype in interface Scriptable
Overrides:
getPrototype in interface NativeJavaObject

has

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

has

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

hasInstance

public boolean hasInstance(Scriptable value)
Specified by:
hasInstance in interface Scriptable
Overrides:
hasInstance in interface NativeJavaObject

put

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

put

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

unwrap

public Object unwrap()
Specified by:
unwrap in interface Wrapper
Overrides:
unwrap in interface NativeJavaObject

wrap

public static NativeJavaArray wrap(Scriptable scope,
                                   Object array)