Class EventTargetWrapper

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

    class EventTargetWrapper
    extends org.mozilla.javascript.NativeJavaObject
    A class that wraps an EventTarget instance to expose it in the Rhino engine. Then calling addEventListener with a Rhino function as parameter should redirect the call to addEventListener with a Java function object calling the Rhino function. This class also allows to pass an ECMAScript (Rhino) object as a parameter instead of a function provided the fact that this object has a handleEvent method.
    Version:
    $Id: EventTargetWrapper.java 1803263 2017-07-28 10:51:01Z ssteiner $
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String ADD_NAME  
      static java.lang.String ADDNS_NAME  
      protected RhinoInterpreter interpreter  
      protected static java.util.WeakHashMap mapOfListenerMap  
      static java.lang.String REMOVE_NAME  
      static java.lang.String REMOVENS_NAME  
      • Fields inherited from class org.mozilla.javascript.NativeJavaObject

        isAdapter, javaObject, members, parent, prototype, staticType
      • Fields inherited from interface org.mozilla.javascript.Scriptable

        NOT_FOUND
    • Constructor Summary

      Constructors 
      Constructor Description
      EventTargetWrapper​(org.mozilla.javascript.Scriptable scope, org.w3c.dom.events.EventTarget object, RhinoInterpreter interpreter)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Object get​(java.lang.String name, org.mozilla.javascript.Scriptable start)
      Overriden Rhino method.
      java.util.Map initMap()  
      • Methods inherited from class org.mozilla.javascript.NativeJavaObject

        canConvert, coerceType, createInterfaceAdapter, delete, delete, get, getClassName, getDefaultValue, getIds, getParentScope, getPrototype, has, has, hasInstance, initMembers, put, put, setParentScope, setPrototype, unwrap, wrap
      • Methods inherited from class java.lang.Object

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

      • EventTargetWrapper

        EventTargetWrapper​(org.mozilla.javascript.Scriptable scope,
                           org.w3c.dom.events.EventTarget object,
                           RhinoInterpreter interpreter)
    • Method Detail

      • get

        public java.lang.Object get​(java.lang.String name,
                                    org.mozilla.javascript.Scriptable start)
        Overriden Rhino method.
        Specified by:
        get in interface org.mozilla.javascript.Scriptable
        Overrides:
        get in class org.mozilla.javascript.NativeJavaObject
      • initMap

        public java.util.Map initMap()