Class ScriptableList
java.lang.Object
sun.org.mozilla.javascript.NativeJavaObject
com.randomnoun.common.jessop.engine.rhinoOpenjdk.ScriptableList
- All Implemented Interfaces:
Serializable
,sun.org.mozilla.javascript.Scriptable
,sun.org.mozilla.javascript.Wrapper
ScriptableList is a wrapper for java.util.List instances that allows developers
to interact with them like it was a native JavaScript array.
- See Also:
-
Field Summary
Fields inherited from class sun.org.mozilla.javascript.NativeJavaObject
isAdapter, javaObject, members, parent, prototype, staticType
Fields inherited from interface sun.org.mozilla.javascript.Scriptable
NOT_FOUND
-
Constructor Summary
ConstructorDescriptionScriptableList
(sun.org.mozilla.javascript.Scriptable scope, List list) Create a ScriptableList wrapper around a java.util.List. -
Method Summary
Modifier and TypeMethodDescriptionvoid
delete
(int index) get
(int index, sun.org.mozilla.javascript.Scriptable start) getDefaultValue
(Class typeHint) Object[]
getIds()
getList()
boolean
has
(int index, sun.org.mozilla.javascript.Scriptable start) static void
init
(sun.org.mozilla.javascript.Scriptable scope) protected void
initPrototype
(sun.org.mozilla.javascript.Scriptable scope) Set the prototype to the Array prototype so we can use array methds such as push, pop, shift, slice etc.void
void
toString()
unwrap()
Methods inherited from class sun.org.mozilla.javascript.NativeJavaObject
canConvert, coerceType, createInterfaceAdapter, delete, getParentScope, getPrototype, has, hasInstance, initMembers, setParentScope, setPrototype, wrap
-
Constructor Details
-
ScriptableList
Create a ScriptableList wrapper around a java.util.List.- Parameters:
scope
- the scopelist
- the list instance
-
-
Method Details
-
init
- Throws:
NoSuchMethodException
-
initPrototype
Set the prototype to the Array prototype so we can use array methds such as push, pop, shift, slice etc.- Parameters:
scope
- the global scope for looking up the Array constructor
-
delete
- Specified by:
delete
in interfacesun.org.mozilla.javascript.Scriptable
- Overrides:
delete
in classsun.org.mozilla.javascript.NativeJavaObject
-
get
- Specified by:
get
in interfacesun.org.mozilla.javascript.Scriptable
- Overrides:
get
in classsun.org.mozilla.javascript.NativeJavaObject
-
has
- Specified by:
has
in interfacesun.org.mozilla.javascript.Scriptable
- Overrides:
has
in classsun.org.mozilla.javascript.NativeJavaObject
-
put
- Specified by:
put
in interfacesun.org.mozilla.javascript.Scriptable
- Overrides:
put
in classsun.org.mozilla.javascript.NativeJavaObject
-
put
- Specified by:
put
in interfacesun.org.mozilla.javascript.Scriptable
- Overrides:
put
in classsun.org.mozilla.javascript.NativeJavaObject
-
get
- Specified by:
get
in interfacesun.org.mozilla.javascript.Scriptable
- Overrides:
get
in classsun.org.mozilla.javascript.NativeJavaObject
-
getIds
- Specified by:
getIds
in interfacesun.org.mozilla.javascript.Scriptable
- Overrides:
getIds
in classsun.org.mozilla.javascript.NativeJavaObject
-
toString
-
getDefaultValue
- Specified by:
getDefaultValue
in interfacesun.org.mozilla.javascript.Scriptable
- Overrides:
getDefaultValue
in classsun.org.mozilla.javascript.NativeJavaObject
-
unwrap
- Specified by:
unwrap
in interfacesun.org.mozilla.javascript.Wrapper
- Overrides:
unwrap
in classsun.org.mozilla.javascript.NativeJavaObject
-
getList
-
getClassName
- Specified by:
getClassName
in interfacesun.org.mozilla.javascript.Scriptable
- Overrides:
getClassName
in classsun.org.mozilla.javascript.NativeJavaObject
-