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:
  - Serialized Form

## 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

Constructors
Constructor
Description
`MapWrapper()`
Creates a new MapWrapper object.
`MapWrapper(Map map, RhinoCore core)`
Creates a new MapWrapper object.

## Method Summary

Modifier and Type
Method
Description
`void`
`delete(int idx)`
`void`
`delete(String name)`
`Object`
`get(int idx, org.mozilla.javascript.Scriptable start)`
`Object`
`get(String name, org.mozilla.javascript.Scriptable start)`
`String`
`getClassName()`
Return the class name for wrapped maps.
`Object`
`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`
`has(String name, org.mozilla.javascript.Scriptable start)`
`void`
`put(int idx, org.mozilla.javascript.Scriptable start, Object value)`
`void`
`put(String name, org.mozilla.javascript.Scriptable start, Object value)`
`String`
`toString()`
Return a string representation for this wrapped map.
`Object`
`unwrap()`
Return the wrapped Map object.

### Methods inherited from class org.mozilla.javascript.ScriptableObject

`applyDescriptorToAttributeBitset, associateValue, avoidObjectDetection, buildDataDescriptor, callMethod, callMethod, checkPropertyChangeForSlot, checkPropertyDefinition, defineClass, defineClass, defineClass, defineConst, defineConstProperty, defineFunctionProperties, defineOwnProperties, defineOwnProperty, defineOwnProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, delete, deleteProperty, deleteProperty, deleteProperty, ensureScriptable, ensureScriptableObject, ensureScriptableObjectButNotSymbol, ensureSymbolScriptable, equivalentValues, get, get, getAllIds, getArrayPrototype, getAssociatedValue, getAttributes, getAttributes, getAttributes, getAttributes, getAttributes, getClassPrototype, getDefaultValue, getExternalArrayData, getExternalArrayLength, getFunctionPrototype, getGeneratorFunctionPrototype, getGetterOrSetter, getGetterOrSetter, getObjectPrototype, getOwnPropertyDescriptor, getParentScope, getProperty, getProperty, getProperty, getPropertyIds, getPrototype, getSuperProperty, getSuperProperty, getSuperProperty, getTopLevelScope, getTopScopeValue, getTypedProperty, getTypedProperty, getTypeOf, has, hasInstance, hasProperty, hasProperty, hasProperty, isAccessorDescriptor, isConst, isDataDescriptor, isEmpty, isExtensible, isFalse, isGenericDescriptor, isGetterOrSetter, isSealed, isTrue, preventExtensions, put, putConst, putConstProperty, putOwnProperty, putOwnProperty, putOwnProperty, putProperty, putProperty, putProperty, putSuperProperty, putSuperProperty, putSuperProperty, querySlot, redefineProperty, sameValue, sealObject, setAttributes, setAttributes, setAttributes, setAttributes, setAttributes, setCommonDescriptorProperties, setExternalArrayData, setGetterOrSetter, setParentScope, setPrototype, size`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

## Constructor Details

### MapWrapper

public MapWrapper()
Creates a new MapWrapper object.

### MapWrapper

public MapWrapper(Map map, RhinoCore core)
Creates a new MapWrapper object.

Parameters:
  `map` - the Map
  `core` - the RhinoCore instance

## Method Details

### put

public void put(String name, org.mozilla.javascript.Scriptable start, Object value)

Specified by:
  `put` in interface `org.mozilla.javascript.Scriptable`
Overrides:
  `put` in class `org.mozilla.javascript.ScriptableObject`
Parameters:
  `name` - ...
  `start` - ...
  `value` - ...

### get

public Object get(String name, org.mozilla.javascript.Scriptable start)

Specified by:
  `get` in interface `org.mozilla.javascript.Scriptable`
Overrides:
  `get` in class `org.mozilla.javascript.ScriptableObject`
Parameters:
  `name` - ...
  `start` - ...
Returns:
  ...

### has

public boolean has(String name, org.mozilla.javascript.Scriptable start)

Specified by:
  `has` in interface `org.mozilla.javascript.Scriptable`
Overrides:
  `has` in class `org.mozilla.javascript.ScriptableObject`
Parameters:
  `name` - ...
  `start` - ...
Returns:
  ...

### delete

public void delete(String name)

Specified by:
  `delete` in interface `org.mozilla.javascript.Scriptable`
Overrides:
  `delete` in class `org.mozilla.javascript.ScriptableObject`
Parameters:
  `name` - ...

### put

public void put(int idx, org.mozilla.javascript.Scriptable start, Object value)

Specified by:
  `put` in interface `org.mozilla.javascript.Scriptable`
Overrides:
  `put` in class `org.mozilla.javascript.ScriptableObject`
Parameters:
  `idx` - ...
  `start` - ...
  `value` - ...

### get

public Object get(int idx, org.mozilla.javascript.Scriptable start)

Specified by:
  `get` in interface `org.mozilla.javascript.Scriptable`
Overrides:
  `get` in class `org.mozilla.javascript.ScriptableObject`
Parameters:
  `idx` - ...
  `start` - ...
Returns:
  ...

### has

public boolean has(int idx, org.mozilla.javascript.Scriptable start)

Specified by:
  `has` in interface `org.mozilla.javascript.Scriptable`
Overrides:
  `has` in class `org.mozilla.javascript.ScriptableObject`
Parameters:
  `idx` - ...
  `start` - ...
Returns:
  ...

### delete

public void delete(int idx)

Specified by:
  `delete` in interface `org.mozilla.javascript.Scriptable`
Overrides:
  `delete` in class `org.mozilla.javascript.ScriptableObject`
Parameters:
  `idx` - ...

### getIds

public Object[] getIds()
Return an array containing the property key values of this map.

Specified by:
  `getIds` in interface `org.mozilla.javascript.Scriptable`
Overrides:
  `getIds` in class `org.mozilla.javascript.ScriptableObject`

### getDefaultValue

public Object getDefaultValue(Class hint)

Specified by:
  `getDefaultValue` in interface `org.mozilla.javascript.Scriptable`
Overrides:
  `getDefaultValue` in class `org.mozilla.javascript.ScriptableObject`

### unwrap

public Object unwrap()
Return the wrapped Map object.

Specified by:
  `unwrap` in interface `org.mozilla.javascript.Wrapper`

### getClassName

public String getClassName()
Return the class name for wrapped maps.

Specified by:
  `getClassName` in interface `org.mozilla.javascript.Scriptable`
Specified by:
  `getClassName` in class `org.mozilla.javascript.ScriptableObject`

### toString

public String toString()
Return a string representation for this wrapped map. This calls Map.toString(), so usually the contents of the map will be listed.

Overrides:
  `toString` in class `Object`