Package helma.scripting.rhino
Class MapWrapper
- java.lang.Object
-
- org.mozilla.javascript.ScriptableObject
-
- helma.scripting.rhino.MapWrapper
-
- All Implemented Interfaces:
java.io.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
-
-
Constructor Summary
Constructors Constructor Description MapWrapper()
Creates a new MapWrapper object.MapWrapper(java.util.Map map, RhinoCore core)
Creates a new MapWrapper object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
delete(int idx)
void
delete(java.lang.String name)
java.lang.Object
get(int idx, org.mozilla.javascript.Scriptable start)
java.lang.Object
get(java.lang.String name, org.mozilla.javascript.Scriptable start)
java.lang.String
getClassName()
Return the class name for wrapped maps.java.lang.Object
getDefaultValue(java.lang.Class hint)
java.lang.Object[]
getIds()
Return an array containing the property key values of this map.boolean
has(int idx, org.mozilla.javascript.Scriptable start)
boolean
has(java.lang.String name, org.mozilla.javascript.Scriptable start)
void
put(int idx, org.mozilla.javascript.Scriptable start, java.lang.Object value)
void
put(java.lang.String name, org.mozilla.javascript.Scriptable start, java.lang.Object value)
java.lang.String
toString()
Return a string representation for this wrapped map.java.lang.Object
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, 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 Detail
-
MapWrapper
public MapWrapper()
Creates a new MapWrapper object.
-
MapWrapper
public MapWrapper(java.util.Map map, RhinoCore core)
Creates a new MapWrapper object.- Parameters:
map
- the Mapcore
- the RhinoCore instance
-
-
Method Detail
-
put
public void put(java.lang.String name, org.mozilla.javascript.Scriptable start, java.lang.Object value)
- Specified by:
put
in interfaceorg.mozilla.javascript.Scriptable
- Overrides:
put
in classorg.mozilla.javascript.ScriptableObject
- Parameters:
name
- ...start
- ...value
- ...
-
get
public java.lang.Object get(java.lang.String name, org.mozilla.javascript.Scriptable start)
- Specified by:
get
in interfaceorg.mozilla.javascript.Scriptable
- Overrides:
get
in classorg.mozilla.javascript.ScriptableObject
- Parameters:
name
- ...start
- ...- Returns:
- ...
-
has
public boolean has(java.lang.String name, org.mozilla.javascript.Scriptable start)
- Specified by:
has
in interfaceorg.mozilla.javascript.Scriptable
- Overrides:
has
in classorg.mozilla.javascript.ScriptableObject
- Parameters:
name
- ...start
- ...- Returns:
- ...
-
delete
public void delete(java.lang.String name)
- Specified by:
delete
in interfaceorg.mozilla.javascript.Scriptable
- Overrides:
delete
in classorg.mozilla.javascript.ScriptableObject
- Parameters:
name
- ...
-
put
public void put(int idx, org.mozilla.javascript.Scriptable start, java.lang.Object value)
- Specified by:
put
in interfaceorg.mozilla.javascript.Scriptable
- Overrides:
put
in classorg.mozilla.javascript.ScriptableObject
- Parameters:
idx
- ...start
- ...value
- ...
-
get
public java.lang.Object get(int idx, org.mozilla.javascript.Scriptable start)
- 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
public java.lang.Object[] 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
public java.lang.Object getDefaultValue(java.lang.Class hint)
- Specified by:
getDefaultValue
in interfaceorg.mozilla.javascript.Scriptable
- Overrides:
getDefaultValue
in classorg.mozilla.javascript.ScriptableObject
-
unwrap
public java.lang.Object unwrap()
Return the wrapped Map object.- Specified by:
unwrap
in interfaceorg.mozilla.javascript.Wrapper
-
getClassName
public java.lang.String 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
public java.lang.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 classjava.lang.Object
-
-