helma.scripting.rhino
Class MapWrapper

java.lang.Object
  extended by org.mozilla.javascript.ScriptableObject
      extended by 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.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

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
MapWrapper()
          Creates a new MapWrapper object.
MapWrapper(java.util.Map map, RhinoCore core)
          Creates a new MapWrapper object.
 
Method Summary
 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
associateValue, avoidObjectDetection, callMethod, callMethod, defineClass, defineClass, defineClass, defineConst, defineConstProperty, defineFunctionProperties, defineProperty, defineProperty, defineProperty, defineProperty, deleteProperty, deleteProperty, equivalentValues, getAllIds, getAssociatedValue, getAttributes, getAttributes, getAttributes, getAttributes, getClassPrototype, getDefaultValue, getFunctionPrototype, getGetterOrSetter, getObjectPrototype, getParentScope, getProperty, getProperty, getPropertyIds, getPrototype, getTopLevelScope, getTopScopeValue, hasInstance, hasProperty, hasProperty, isConst, isSealed, putConst, putConstProperty, putProperty, putProperty, redefineProperty, sealObject, setAttributes, setAttributes, setAttributes, setAttributes, setGetterOrSetter, setParentScope, setPrototype
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

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 Map
core - 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 interface org.mozilla.javascript.Scriptable
Overrides:
put in class org.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 interface org.mozilla.javascript.Scriptable
Overrides:
get in class org.mozilla.javascript.ScriptableObject
Parameters:
name - ...
start - ...
Returns:
...

has

public boolean has(java.lang.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(java.lang.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,
                java.lang.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 java.lang.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 java.lang.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 java.lang.Object getDefaultValue(java.lang.Class hint)
Specified by:
getDefaultValue in interface org.mozilla.javascript.Scriptable
Overrides:
getDefaultValue in class org.mozilla.javascript.ScriptableObject

unwrap

public java.lang.Object unwrap()
Return the wrapped Map object.

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

getClassName

public java.lang.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 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 class java.lang.Object


Copyright © 1998-1998-${year} Helma.org. All Rights Reserved.