Class 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
    • 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​(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
      • 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