Package helma.scripting.rhino
Class MapWrapper
java.lang.Object
org.mozilla.javascript.ScriptableObject
helma.scripting.rhino.MapWrapper
- All Implemented Interfaces:
Serializable
,org.mozilla.javascript.ConstProperties
,org.mozilla.javascript.debug.DebuggableObject
,org.mozilla.javascript.Scriptable
,org.mozilla.javascript.SymbolScriptable
,org.mozilla.javascript.Wrapper
public class MapWrapper
extends org.mozilla.javascript.ScriptableObject
implements org.mozilla.javascript.Wrapper
A class that wraps a Java Map as a native JavaScript object. This is
used by the RhinoCore Wrapper for instances of helma.util.SystemMap
and helma.util.WrappedMap.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.mozilla.javascript.ScriptableObject
org.mozilla.javascript.ScriptableObject.KeyComparator
-
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
ConstructorsConstructorDescriptionCreates a new MapWrapper object.MapWrapper
(Map map, RhinoCore core) Creates a new MapWrapper object. -
Method Summary
Modifier and TypeMethodDescriptionvoid
delete
(int idx) void
get
(int idx, org.mozilla.javascript.Scriptable start) Return the class name for wrapped maps.getDefaultValue
(Class hint) Object[]
getIds()
Return an array containing the property key values of this map.boolean
has
(int idx, org.mozilla.javascript.Scriptable start) boolean
void
void
toString()
Return a string representation for this wrapped map.unwrap()
Return the wrapped Map object.Methods inherited from class org.mozilla.javascript.ScriptableObject
applyDescriptorToAttributeBitset, associateValue, avoidObjectDetection, buildDataDescriptor, callMethod, callMethod, checkPropertyChange, checkPropertyDefinition, defineClass, defineClass, defineClass, defineConst, defineConstProperty, defineFunctionProperties, defineOwnProperties, defineOwnProperty, defineOwnProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, delete, deleteProperty, deleteProperty, ensureScriptable, ensureScriptableObject, ensureSymbolScriptable, equivalentValues, get, get, getAllIds, getArrayPrototype, getAssociatedValue, getAttributes, getAttributes, getAttributes, getAttributes, getAttributes, getClassPrototype, getDefaultValue, getExternalArrayData, getExternalArrayLength, getFunctionPrototype, getGeneratorFunctionPrototype, getGetterOrSetter, getObjectPrototype, getOwnPropertyDescriptor, getParentScope, getProperty, getProperty, getProperty, getPropertyIds, getPrototype, getSlot, getTopLevelScope, getTopScopeValue, getTypedProperty, getTypedProperty, getTypeOf, has, hasInstance, hasProperty, hasProperty, hasProperty, isAccessorDescriptor, isConst, isDataDescriptor, isEmpty, isExtensible, isFalse, isGenericDescriptor, isGetterOrSetter, isSealed, isTrue, preventExtensions, put, putConst, putConstProperty, putProperty, putProperty, putProperty, redefineProperty, sameValue, sealObject, setAttributes, setAttributes, setAttributes, setAttributes, setAttributes, setExternalArrayData, setGetterOrSetter, setParentScope, setPrototype, size
-
Constructor Details
-
MapWrapper
public MapWrapper()Creates a new MapWrapper object. -
MapWrapper
Creates a new MapWrapper object.- Parameters:
map
- the Mapcore
- the RhinoCore instance
-
-
Method Details
-
put
- Specified by:
put
in interfaceorg.mozilla.javascript.Scriptable
- Overrides:
put
in classorg.mozilla.javascript.ScriptableObject
- Parameters:
name
- ...start
- ...value
- ...
-
get
- Specified by:
get
in interfaceorg.mozilla.javascript.Scriptable
- Overrides:
get
in classorg.mozilla.javascript.ScriptableObject
- Parameters:
name
- ...start
- ...- Returns:
- ...
-
has
- Specified by:
has
in interfaceorg.mozilla.javascript.Scriptable
- Overrides:
has
in classorg.mozilla.javascript.ScriptableObject
- Parameters:
name
- ...start
- ...- Returns:
- ...
-
delete
- Specified by:
delete
in interfaceorg.mozilla.javascript.Scriptable
- Overrides:
delete
in classorg.mozilla.javascript.ScriptableObject
- Parameters:
name
- ...
-
put
- Specified by:
put
in interfaceorg.mozilla.javascript.Scriptable
- Overrides:
put
in classorg.mozilla.javascript.ScriptableObject
- Parameters:
idx
- ...start
- ...value
- ...
-
get
- Specified by:
get
in interfaceorg.mozilla.javascript.Scriptable
- Overrides:
get
in classorg.mozilla.javascript.ScriptableObject
- Parameters:
idx
- ...start
- ...- Returns:
- ...
-
has
public boolean has(int idx, org.mozilla.javascript.Scriptable start) - Specified by:
has
in interfaceorg.mozilla.javascript.Scriptable
- Overrides:
has
in classorg.mozilla.javascript.ScriptableObject
- Parameters:
idx
- ...start
- ...- Returns:
- ...
-
delete
public void delete(int idx) - Specified by:
delete
in interfaceorg.mozilla.javascript.Scriptable
- Overrides:
delete
in classorg.mozilla.javascript.ScriptableObject
- Parameters:
idx
- ...
-
getIds
Return an array containing the property key values of this map.- Specified by:
getIds
in interfaceorg.mozilla.javascript.Scriptable
- Overrides:
getIds
in classorg.mozilla.javascript.ScriptableObject
-
getDefaultValue
- Specified by:
getDefaultValue
in interfaceorg.mozilla.javascript.Scriptable
- Overrides:
getDefaultValue
in classorg.mozilla.javascript.ScriptableObject
-
unwrap
Return the wrapped Map object.- Specified by:
unwrap
in interfaceorg.mozilla.javascript.Wrapper
-
getClassName
Return the class name for wrapped maps.- Specified by:
getClassName
in interfaceorg.mozilla.javascript.Scriptable
- Specified by:
getClassName
in classorg.mozilla.javascript.ScriptableObject
-
toString
Return a string representation for this wrapped map. This calls Map.toString(), so usually the contents of the map will be listed.
-