Module org.htmlunit

Class EventHandler

java.lang.Object
org.htmlunit.corejs.javascript.SlotMapOwner<org.htmlunit.corejs.javascript.Scriptable>
org.htmlunit.corejs.javascript.ScriptableObject
org.htmlunit.corejs.javascript.BaseFunction
org.htmlunit.javascript.host.event.EventHandler
All Implemented Interfaces:
Serializable, org.htmlunit.corejs.javascript.Callable, org.htmlunit.corejs.javascript.ConstProperties<org.htmlunit.corejs.javascript.Scriptable>, org.htmlunit.corejs.javascript.Constructable, org.htmlunit.corejs.javascript.debug.DebuggableObject, org.htmlunit.corejs.javascript.Function, org.htmlunit.corejs.javascript.PropHolder<org.htmlunit.corejs.javascript.Scriptable>, org.htmlunit.corejs.javascript.Scriptable, org.htmlunit.corejs.javascript.SymbolScriptable

public class EventHandler extends org.htmlunit.corejs.javascript.BaseFunction
Wraps event handler code as a Function object.
Author:
Marc Guillemot, Ronald Brill
See Also:
  • Nested Class Summary

    Nested classes/interfaces inherited from class org.htmlunit.corejs.javascript.ScriptableObject

    org.htmlunit.corejs.javascript.ScriptableObject.DescriptorInfo, org.htmlunit.corejs.javascript.ScriptableObject.KeyComparator, org.htmlunit.corejs.javascript.ScriptableObject.LambdaGetterFunction, org.htmlunit.corejs.javascript.ScriptableObject.LambdaSetterFunction
  • Field Summary

    Fields inherited from class org.htmlunit.corejs.javascript.BaseFunction

    Id_arguments, Id_arity, Id_length, Id_name, Id_prototype, MAX_INSTANCE_ID

    Fields inherited from class org.htmlunit.corejs.javascript.ScriptableObject

    CONST, DONTENUM, EMPTY, PERMANENT, READONLY, UNINITIALIZED_CONST

    Fields inherited from class org.htmlunit.corejs.javascript.SlotMapOwner

    isSealed

    Fields inherited from interface org.htmlunit.corejs.javascript.Scriptable

    NOT_FOUND
  • Constructor Summary

    Constructors
    Constructor
    Description
    EventHandler(org.htmlunit.corejs.javascript.VarScope scope, DomNode node, String eventName, String jsSnippet)
    Builds a function that will execute the given JavaScript code.
  • Method Summary

    Modifier and Type
    Method
    Description
    call(org.htmlunit.corejs.javascript.Context cx, Object nt, org.htmlunit.corejs.javascript.VarScope scope, Object thisObj, Object[] args)
    get(String name, org.htmlunit.corejs.javascript.Scriptable start)
    getDefaultValue(Class<?> typeHint)
    Returns the JavaScript source representation of this function declaration.

    Methods inherited from class org.htmlunit.corejs.javascript.BaseFunction

    call, construct, createObject, createObject, createProperties, createPrototypeProperty, createPrototypeProperty, defaultGet, defaultHas, defaultPut, getArity, getClassName, getClassPrototype, getDeclarationScope, getFunctionName, getHomeObject, getLength, getPrototypeProperty, getTypeOf, hasDefaultParameters, hasInstance, hasPrototypeProperty, isConstructor, isGeneratorFunction, prototypeDescSetter, setHomeObject, setImmunePrototypeProperty, setPrototypeProperty, setPrototypePropertyAttributes, setStandardPropertyAttributes, setupDefaultPrototype

    Methods inherited from class org.htmlunit.corejs.javascript.ScriptableObject

    applyDescriptorToAttributeBitset, avoidObjectDetection, buildDataDescriptor, callMethod, callMethod, checkNotSealed, checkPropertyChangeForSlot, checkPropertyChangeForSlot, checkPropertyDefinition, checkPropertyDefinition, checkSlotRemoval, defineBuiltinProperty, defineBuiltinProperty, defineBuiltInProperty, defineClass, defineClass, defineClass, defineConst, defineConstProperty, defineFunctionProperties, defineOwnProperties, defineOwnProperty, defineOwnProperty, defineOwnProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, delete, delete, delete, deleteProperty, deleteProperty, deleteProperty, ensureScriptable, ensureScriptableObject, ensureScriptableObjectButNotSymbol, ensureSymbolScriptable, ensureType, equivalentValues, get, get, getAllIds, getAncestor, getArrayPrototype, getClassPrototype, getClassPrototype, getDefaultValue, getExternalArrayData, getExternalArrayLength, getFunctionPrototype, getGeneratorFunctionPrototype, getGetterOrSetter, getGetterOrSetter, getObjectPrototype, getOwnPropertyDescriptor, getParentScope, getProperty, getProperty, getProperty, getProperty, getProperty, getPropertyIds, getPrototype, getSuperProperty, getSuperProperty, getSuperProperty, getThis, getTopLevelScope, getTopScopeValue, getTypedProperty, getTypedProperty, has, hasProperty, hasProperty, hasProperty, hasProperty, isAccessorDescriptor, isAccessorDescriptor, isConst, isDataDescriptor, isEmpty, isExtensible, isFalse, isGenericDescriptor, isGenericDescriptor, isGetterOrSetter, isGetterOrSetter, isTrue, preventExtensions, put, put, put, putConst, putConstProperty, putConstProperty, putOwnProperty, putOwnProperty, putOwnProperty, putProperty, putProperty, putProperty, putProperty, putSuperProperty, putSuperProperty, putSuperProperty, querySlot, redefineProperty, redefineProperty, sameValue, sealObject, setCommonDescriptorProperties, setExternalArrayData, setGetterOrSetter, setParentScope, setPrototype, size

    Methods inherited from class org.htmlunit.corejs.javascript.SlotMapOwner

    associateValue, checkNotSealed, copyAssociatedValue, createSlotMap, createSlotMap, defineProperty, defineProperty, get, getAssociatedValue, getAttributes, getAttributes, getAttributes, getAttributes, getAttributes, getIds, has, has, isSealed, readMaps, setAttributes, setAttributes, setAttributes, setAttributes, setAttributes, writeMaps

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.htmlunit.corejs.javascript.Constructable

    construct

    Methods inherited from interface org.htmlunit.corejs.javascript.Scriptable

    delete, delete, delete, get, get, getAncestor, getIds, getParentScope, getPrototype, has, has, has, put, put, put, setParentScope, setPrototype

    Methods inherited from interface org.htmlunit.corejs.javascript.SymbolScriptable

    get, has
  • Constructor Details

    • EventHandler

      public EventHandler(org.htmlunit.corejs.javascript.VarScope scope, DomNode node, String eventName, String jsSnippet)
      Builds a function that will execute the given JavaScript code.
      Parameters:
      scope - the scope
      node - the element for which the event is built
      eventName - the event name for which this handler is created
      jsSnippet - the JavaScript code snippet to execute
  • Method Details

    • call

      public Object call(org.htmlunit.corejs.javascript.Context cx, Object nt, org.htmlunit.corejs.javascript.VarScope scope, Object thisObj, Object[] args) throws org.htmlunit.corejs.javascript.JavaScriptException
      Overrides:
      call in class org.htmlunit.corejs.javascript.BaseFunction
      Throws:
      org.htmlunit.corejs.javascript.JavaScriptException
    • getDefaultValue

      public Object getDefaultValue(Class<?> typeHint)
      Returns the JavaScript source representation of this function declaration.
      Specified by:
      getDefaultValue in interface org.htmlunit.corejs.javascript.Scriptable
      Overrides:
      getDefaultValue in class org.htmlunit.corejs.javascript.ScriptableObject
      Parameters:
      typeHint - the type hint
      Returns:
      the JavaScript source of the function declaration
      See Also:
      • ScriptableObject.getDefaultValue(java.lang.Class)
    • get

      public Object get(String name, org.htmlunit.corejs.javascript.Scriptable start)
      Specified by:
      get in interface org.htmlunit.corejs.javascript.PropHolder<org.htmlunit.corejs.javascript.Scriptable>
      Specified by:
      get in interface org.htmlunit.corejs.javascript.Scriptable
      Overrides:
      get in class org.htmlunit.corejs.javascript.ScriptableObject