Class NativeMap

  • All Implemented Interfaces:
    org.mozilla.javascript.Scriptable, org.mozilla.javascript.Wrapper

    public class NativeMap
    extends java.lang.Object
    implements org.mozilla.javascript.Scriptable, org.mozilla.javascript.Wrapper
    Wrapper for exposing maps in Rhino scripts. Note: A duplicate of this map implementation exists in the Repository project
    Author:
    davidc
    • Field Summary

      • Fields inherited from interface org.mozilla.javascript.Scriptable

        NOT_FOUND
    • Constructor Summary

      Constructors 
      Constructor Description
      NativeMap​(org.mozilla.javascript.Scriptable scope, java.util.Map<java.lang.Object,​java.lang.Object> map)
      Construct
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void delete​(int index)  
      void delete​(java.lang.String name)  
      java.lang.Object get​(int index, org.mozilla.javascript.Scriptable start)  
      java.lang.Object get​(java.lang.String name, org.mozilla.javascript.Scriptable start)  
      java.lang.String getClassName()  
      java.lang.Object getDefaultValue​(java.lang.Class hint)  
      java.lang.Object[] getIds()  
      org.mozilla.javascript.Scriptable getParentScope()  
      org.mozilla.javascript.Scriptable getPrototype()  
      boolean has​(int index, org.mozilla.javascript.Scriptable start)  
      boolean has​(java.lang.String name, org.mozilla.javascript.Scriptable start)  
      boolean hasInstance​(org.mozilla.javascript.Scriptable value)  
      void put​(int index, org.mozilla.javascript.Scriptable start, java.lang.Object value)  
      void put​(java.lang.String name, org.mozilla.javascript.Scriptable start, java.lang.Object value)  
      void setParentScope​(org.mozilla.javascript.Scriptable parent)  
      void setPrototype​(org.mozilla.javascript.Scriptable prototype)  
      java.lang.Object unwrap()  
      static NativeMap wrap​(org.mozilla.javascript.Scriptable scope, java.util.Map<java.lang.Object,​java.lang.Object> map)
      Construct
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • NativeMap

        public NativeMap​(org.mozilla.javascript.Scriptable scope,
                         java.util.Map<java.lang.Object,​java.lang.Object> map)
        Construct
        Parameters:
        scope - Scriptable
        map - Map
    • Method Detail

      • wrap

        public static NativeMap wrap​(org.mozilla.javascript.Scriptable scope,
                                     java.util.Map<java.lang.Object,​java.lang.Object> map)
        Construct
        Parameters:
        scope - Scriptable
        map - Map
        Returns:
        native map
      • unwrap

        public java.lang.Object unwrap()
        Specified by:
        unwrap in interface org.mozilla.javascript.Wrapper
      • getClassName

        public java.lang.String getClassName()
        Specified by:
        getClassName in interface org.mozilla.javascript.Scriptable
      • get

        public java.lang.Object get​(java.lang.String name,
                                    org.mozilla.javascript.Scriptable start)
        Specified by:
        get in interface org.mozilla.javascript.Scriptable
      • get

        public java.lang.Object get​(int index,
                                    org.mozilla.javascript.Scriptable start)
        Specified by:
        get in interface org.mozilla.javascript.Scriptable
      • has

        public boolean has​(java.lang.String name,
                           org.mozilla.javascript.Scriptable start)
        Specified by:
        has in interface org.mozilla.javascript.Scriptable
      • has

        public boolean has​(int index,
                           org.mozilla.javascript.Scriptable start)
        Specified by:
        has in interface org.mozilla.javascript.Scriptable
      • 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
      • put

        public void put​(int index,
                        org.mozilla.javascript.Scriptable start,
                        java.lang.Object value)
        Specified by:
        put in interface org.mozilla.javascript.Scriptable
      • delete

        public void delete​(java.lang.String name)
        Specified by:
        delete in interface org.mozilla.javascript.Scriptable
      • delete

        public void delete​(int index)
        Specified by:
        delete in interface org.mozilla.javascript.Scriptable
      • getPrototype

        public org.mozilla.javascript.Scriptable getPrototype()
        Specified by:
        getPrototype in interface org.mozilla.javascript.Scriptable
      • setPrototype

        public void setPrototype​(org.mozilla.javascript.Scriptable prototype)
        Specified by:
        setPrototype in interface org.mozilla.javascript.Scriptable
      • getParentScope

        public org.mozilla.javascript.Scriptable getParentScope()
        Specified by:
        getParentScope in interface org.mozilla.javascript.Scriptable
      • setParentScope

        public void setParentScope​(org.mozilla.javascript.Scriptable parent)
        Specified by:
        setParentScope in interface org.mozilla.javascript.Scriptable
      • getIds

        public java.lang.Object[] getIds()
        Specified by:
        getIds in interface org.mozilla.javascript.Scriptable
      • getDefaultValue

        public java.lang.Object getDefaultValue​(java.lang.Class hint)
        Specified by:
        getDefaultValue in interface org.mozilla.javascript.Scriptable
      • hasInstance

        public boolean hasInstance​(org.mozilla.javascript.Scriptable value)
        Specified by:
        hasInstance in interface org.mozilla.javascript.Scriptable