new EventHandlerExecutionMetadata()

Manages metadata during event handler execution.

Description

Manages metadata during event handler execution.

Properties
Name Type Description
returnValue boolean

Current return value of this event handler execution, this value is true until the first (pre) event handler returns false, and cannot change back to true afterwards.

handlerName string

Name of the executed event handlers.

handlerReturnValues Object.<string, Array.<*>>

Array of return values of handlers by plugin name. Return values can be boolean as well as complex types.

handlerPlugins Array.<string>

Array of plugins which have handled this event.

data Object.<string, *>

Additional custom event handling metadata.

Classes


new Proxy()

Metadata proxy for plugins which makes setting and getting properties more convenient.

Methods


<private> _provideHandlerReturnValuesObject( pluginName, pushToHandlers )

Creates the array for handler return values for the given plugin if it doesn't exist.

Description

Creates the array for handler return values for the given plugin if it doesn't exist.

Parameters
Name Type Description
pluginName string

Name of the plugin.

pushToHandlers boolean

Whether to push the plugin name to the list of handler plugins.


forPlugin( pluginName ) → {EventHandlerExecutionMetadata~Proxy}

Creates a metadata proxy for the given plugin name.

Description

Creates a metadata proxy for the given plugin name.

Parameters
Name Type Description
pluginName string

Name of the plugin.


get( pluginName, property ) → {undefined|*}

Returns the custom metadata stored for the given property and plugin.

Description

Returns the custom metadata stored for the given property and plugin.

Parameters
Name Type Description
pluginName string

Name of the plugin.

property string

Name of the property.

Returns

The stored value or undefined if no value is stored for the property and plugin nanem.


getReturnValue( pluginName ) → {boolean|*}

Returns the current overall return value or plugin return value.

Description

Returns the current overall return value or plugin return value.

Parameters
Name Type Description
pluginName string

Name of the plugin for which you want to retrieve the registered return values.

Returns

The overall return value if no parameters are given, otherwise it returns the return value of the first handler for the given plugin or undefined if no return values have been registered for the given plugin.


registerReturnValue( pluginName, returnValue ) → {EventHandlerExecutionMetadata}

Registers a return value for the given plugin.

Description

Registers a return value for the given plugin.

Parameters
Name Type Description
pluginName string

Name of the plugin.

returnValue *

Return value of the event handler, can be anyhting. If it is false and the returnValue of this metadata object has been true, it will be changed to false.

Returns

The metadata object.


set( pluginName, property, value ) → {EventHandlerExecutionMetadata}

Sets the custom metadata for the given property and plugin.

Description

Sets the custom metadata for the given property and plugin.

Parameters
Name Type Description
pluginName string

Name of the plugin.

property string

Name of the property.

value *

The value that should be stored.

Returns

The metadata object.