Class ScriptableList
java.lang.Object
org.mozilla.javascript.NativeJavaObject
com.randomnoun.common.jessop.engine.rhino.ScriptableList
- All Implemented Interfaces:
Serializable
,org.mozilla.javascript.Scriptable
,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 org.mozilla.javascript.NativeJavaObject
javaObject, members, parent, prototype, staticType
Fields inherited from interface org.mozilla.javascript.Scriptable
NOT_FOUND
-
Constructor Summary
ConstructorDescriptionScriptableList
(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, org.mozilla.javascript.Scriptable start) getDefaultValue
(Class typeHint) Object[]
getIds()
getList()
boolean
has
(int index, org.mozilla.javascript.Scriptable start) static void
init
(org.mozilla.javascript.Scriptable scope) protected void
initPrototype
(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 org.mozilla.javascript.NativeJavaObject
canConvert, coerceType, 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 interfaceorg.mozilla.javascript.Scriptable
- Overrides:
delete
in classorg.mozilla.javascript.NativeJavaObject
-
get
- Specified by:
get
in interfaceorg.mozilla.javascript.Scriptable
- Overrides:
get
in classorg.mozilla.javascript.NativeJavaObject
-
has
- Specified by:
has
in interfaceorg.mozilla.javascript.Scriptable
- Overrides:
has
in classorg.mozilla.javascript.NativeJavaObject
-
put
- Specified by:
put
in interfaceorg.mozilla.javascript.Scriptable
- Overrides:
put
in classorg.mozilla.javascript.NativeJavaObject
-
put
- Specified by:
put
in interfaceorg.mozilla.javascript.Scriptable
- Overrides:
put
in classorg.mozilla.javascript.NativeJavaObject
-
get
- Specified by:
get
in interfaceorg.mozilla.javascript.Scriptable
- Overrides:
get
in classorg.mozilla.javascript.NativeJavaObject
-
getIds
- Specified by:
getIds
in interfaceorg.mozilla.javascript.Scriptable
- Overrides:
getIds
in classorg.mozilla.javascript.NativeJavaObject
-
toString
-
getDefaultValue
- Specified by:
getDefaultValue
in interfaceorg.mozilla.javascript.Scriptable
- Overrides:
getDefaultValue
in classorg.mozilla.javascript.NativeJavaObject
-
unwrap
- Specified by:
unwrap
in interfaceorg.mozilla.javascript.Wrapper
- Overrides:
unwrap
in classorg.mozilla.javascript.NativeJavaObject
-
getList
-
getClassName
- Specified by:
getClassName
in interfaceorg.mozilla.javascript.Scriptable
- Overrides:
getClassName
in classorg.mozilla.javascript.NativeJavaObject
-