Class EventHandler
- java.lang.Object
-
- org.htmlunit.corejs.javascript.ScriptableObject
-
- org.htmlunit.corejs.javascript.IdScriptableObject
-
- org.htmlunit.corejs.javascript.BaseFunction
-
- org.htmlunit.javascript.host.event.EventHandler
-
- All Implemented Interfaces:
java.io.Serializable
,org.htmlunit.corejs.javascript.Callable
,org.htmlunit.corejs.javascript.ConstProperties
,org.htmlunit.corejs.javascript.Constructable
,org.htmlunit.corejs.javascript.debug.DebuggableObject
,org.htmlunit.corejs.javascript.Function
,org.htmlunit.corejs.javascript.IdFunctionCall
,org.htmlunit.corejs.javascript.Scriptable
,org.htmlunit.corejs.javascript.SymbolScriptable
public class EventHandler extends org.htmlunit.corejs.javascript.BaseFunction
Allows to wrap event handler code as Function object.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.String
eventName_
private java.lang.String
jsSnippet_
private DomNode
node_
private org.htmlunit.corejs.javascript.Function
realFunction_
-
Fields inherited from class org.htmlunit.corejs.javascript.BaseFunction
Id_arguments, Id_arity, Id_length, Id_name, Id_prototype, MAX_INSTANCE_ID
-
-
Constructor Summary
Constructors Constructor Description EventHandler(DomNode node, java.lang.String eventName, java.lang.String jsSnippet)
Builds a function that will execute the JavaScript code provided.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
call(org.htmlunit.corejs.javascript.Context cx, org.htmlunit.corejs.javascript.Scriptable scope, org.htmlunit.corejs.javascript.Scriptable thisObj, java.lang.Object[] args)
java.lang.Object
get(java.lang.String name, org.htmlunit.corejs.javascript.Scriptable start)
java.lang.Object
getDefaultValue(java.lang.Class<?> typeHint)
-
Methods inherited from class org.htmlunit.corejs.javascript.BaseFunction
construct, createObject, execIdCall, fillConstructorProperties, findInstanceIdInfo, findPrototypeId, getArity, getClassName, getClassPrototype, getFunctionName, getInstanceIdName, getInstanceIdValue, getLength, getMaxInstanceId, getPrototypeProperty, getTypeOf, hasInstance, hasPrototypeProperty, initPrototypeId, isGeneratorFunction, setImmunePrototypeProperty, setInstanceIdAttributes, setInstanceIdValue, setPrototypeProperty, setPrototypePropertyAttributes, setStandardPropertyAttributes, setupDefaultPrototype
-
Methods inherited from class org.htmlunit.corejs.javascript.IdScriptableObject
activatePrototypeMap, addIdFunctionProperty, defaultGet, defaultHas, defaultPut, defineOwnProperty, delete, delete, ensureType, exportAsJSClass, findInstanceIdInfo, findPrototypeId, get, getAttributes, getAttributes, getOwnPropertyDescriptor, has, has, hasPrototypeMap, initPrototypeConstructor, initPrototypeMethod, initPrototypeMethod, initPrototypeMethod, initPrototypeValue, initPrototypeValue, instanceIdInfo, put, put, setAttributes
-
Methods inherited from class org.htmlunit.corejs.javascript.ScriptableObject
applyDescriptorToAttributeBitset, associateValue, avoidObjectDetection, buildDataDescriptor, callMethod, callMethod, checkPropertyChange, checkPropertyDefinition, defineClass, defineClass, defineClass, defineConst, defineConstProperty, defineFunctionProperties, defineOwnProperties, defineOwnProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, delete, deleteProperty, deleteProperty, deleteProperty, ensureScriptable, ensureScriptableObject, ensureSymbolScriptable, equivalentValues, get, get, getAllIds, getArrayPrototype, getAssociatedValue, getAttributes, getAttributes, getAttributes, getClassPrototype, getDefaultValue, getExternalArrayData, getExternalArrayLength, getFunctionPrototype, getGeneratorFunctionPrototype, getGetterOrSetter, getGetterOrSetter, getIds, getObjectPrototype, getParentScope, getProperty, getProperty, getProperty, getPropertyIds, getPrototype, getTopLevelScope, getTopScopeValue, getTypedProperty, getTypedProperty, has, hasProperty, hasProperty, hasProperty, isAccessorDescriptor, isConst, isDataDescriptor, isEmpty, isExtensible, isFalse, isGenericDescriptor, isGetterOrSetter, isSealed, isTrue, preventExtensions, put, putConst, putConstProperty, putProperty, putProperty, putProperty, querySlot, redefineProperty, sameValue, sealObject, setAttributes, setAttributes, setAttributes, setAttributes, setCommonDescriptorProperties, setExternalArrayData, setGetterOrSetter, setParentScope, setPrototype, size
-
-
-
-
Field Detail
-
node_
private final DomNode node_
-
eventName_
private final java.lang.String eventName_
-
jsSnippet_
private final java.lang.String jsSnippet_
-
realFunction_
private org.htmlunit.corejs.javascript.Function realFunction_
-
-
Constructor Detail
-
EventHandler
public EventHandler(DomNode node, java.lang.String eventName, java.lang.String jsSnippet)
Builds a function that will execute the JavaScript code provided.- Parameters:
node
- the element for which the event is buildeventName
- the event for which this handler is createdjsSnippet
- the JavaScript code
-
-
Method Detail
-
call
public java.lang.Object call(org.htmlunit.corejs.javascript.Context cx, org.htmlunit.corejs.javascript.Scriptable scope, org.htmlunit.corejs.javascript.Scriptable thisObj, java.lang.Object[] args) throws org.htmlunit.corejs.javascript.JavaScriptException
- Specified by:
call
in interfaceorg.htmlunit.corejs.javascript.Callable
- Specified by:
call
in interfaceorg.htmlunit.corejs.javascript.Function
- Overrides:
call
in classorg.htmlunit.corejs.javascript.BaseFunction
- Throws:
org.htmlunit.corejs.javascript.JavaScriptException
-
getDefaultValue
public java.lang.Object getDefaultValue(java.lang.Class<?> typeHint)
- Specified by:
getDefaultValue
in interfaceorg.htmlunit.corejs.javascript.Scriptable
- Overrides:
getDefaultValue
in classorg.htmlunit.corejs.javascript.ScriptableObject
- Parameters:
typeHint
- the type hint- Returns:
- the js code of the function declaration
- See Also:
ScriptableObject.getDefaultValue(java.lang.Class)
-
get
public java.lang.Object get(java.lang.String name, org.htmlunit.corejs.javascript.Scriptable start)
- Specified by:
get
in interfaceorg.htmlunit.corejs.javascript.Scriptable
- Overrides:
get
in classorg.htmlunit.corejs.javascript.IdScriptableObject
-
-