Retrieves the handler associated with the event.

@param eventType
the given event
@return the associated handler, <code>null</code> if not found
5956
private JClassType getHandlerForEvent(JClassType eventType) {

		// All handlers event must have an overrided method getAssociatedType().
		// We take advantage of this information to get the associated handler.
		// Ex:
		// com.google.gwt.event.dom.client.ClickEvent
		// ---> com.google.gwt.event.dom.client.ClickHandler
		//
		// com.google.gwt.event.dom.client.BlurEvent
		// ---> com.google.gwt.event.dom.client.BlurHandler

		if (eventType == null) {
			return null;
		}

		JMethod method = eventType
				.findMethod("getAssociatedType", new JType[0]);
		if (method == null) {
			logger.warn(
					"Method 'getAssociatedType()' could not be found in the event '%s'.",
					eventType.getName());
			return null;
		}

		JType returnType = method.getReturnType();
		if (returnType == null) {
			logger.warn(
					"The method 'getAssociatedType()' in the event '%s' returns void.",
					eventType.getName());
			return null;
		}

		JParameterizedType isParameterized = returnType.isParameterized();
		if (isParameterized == null) {
			logger.warn(
					"The method 'getAssociatedType()' in '%s' does not return Type<? extends EventHandler>.",
					eventType.getName());
			return null;
		}

		JClassType[] argTypes = isParameterized.getTypeArgs();
		if ((argTypes.length != 1)
				&& !argTypes[0].isAssignableTo(eventHandlerJClass)) {
			logger.warn(
					"The method 'getAssociatedType()' in '%s' does not return Type<? extends EventHandler>.",
					eventType.getName());
			return null;
		}

		return argTypes[0];
	}
232477
function getEventObject(eventObjects, eventType, listener) {
        var i, numberOfEvents = eventObjects.length;

        for (i = 0; i < numberOfEvents; i += 1) {
            if (isValueEqualToValue(eventObjects[i].type, eventType) &&
                    isValueEqualToValue(eventObjects[i].callback, listener)) {
                return eventObjects[i];
            }
        }

        return null;
    }
449360
function (eventType, evt) {
    if (!this.eventListeners) {
      this.eventListeners = {};
    }
    if (!evt) {
      evt = {};
    }
    evt.type = eventType;
    if (!evt.source) {
      evt.source = this;
    }
    var events = this.eventListeners[eventType];
    if (events) {
      var len = events.length;
      for (var i = 0; i < len; i++) {
        events[i].handler.apply(this, [evt]);
      }
    }
    return this;
  }
983277
public <H extends EventHandler> H getHandler(GwtEvent.Type<H> type, int index) {
		return this.eventBus.superGetHandler(type, index);
	}
1003267
public String getEvent_type() {
    if (Event_Type.featOkTst && ((Event_Type)jcasType).casFeat_event_type == null)
      jcasType.jcas.throwFeatMissing("event_type", "ch.epfl.bbp.uima.genia.Event");
    return jcasType.ll_cas.ll_getStringValue(addr, ((Event_Type)jcasType).casFeatCode_event_type);}
905956
function (obj, eventType, eventHandler) {
			if (!obj.eventHandlers) { obj.eventHandlers = {}; }
			if (!obj.eventHandlers[eventType]) {
				obj.eventHandlers[eventType] = [];
			}
			if (eventHandler) {
				obj.eventHandlers[eventType].push(eventHandler);
			}
			return obj.eventHandlers[eventType];
		}
1043006
@SuppressWarnings("unchecked")
    public static <T> EventScope<T> get (final Class<T> pEventType) {

        if (pEventType == Object.class) {
            return null;
        }

        EventScope<T> lResult = (EventScope<T>) sScopes.get (pEventType);

        if (lResult != null) {
            return lResult;
        }

        for (final Class<?> lInterface : pEventType.getInterfaces ()) {

            lResult = (EventScope<T>) sScopes.get (pEventType);

            if (lResult != null) {
                return lResult;
            }

        }

        // still here - dive into super class

        return (EventScope<T>) get (pEventType.getSuperclass ());
    }
1142922
@Beta
    public Type getCustomEventMapping(final String eventType) {
        if (!containsCustomEventMappingFor(eventType)) {
            return null;
        } else {
            return this.eventTypeToEventDataMapping.get(canonicalizeEventType(eventType));
        }
    }
591114
public function attachEventListener($eventType,$handler) {
    if (!$eventType)
      $eventType = $this->getEventPrefix();
    elseif (!strstr($eventType,':') && $eventType != $this->getEventPrefix())
      $eventType = $this->getEventPrefix().':'.$eventType;
    
    return $this->_forceGetEventsManager()->attach($eventType,$handler);
  }
984993
public AutoCloseable registerHandler(
      final Class<? extends T> messageType,
      final EventHandler<RemoteMessage<? extends T>> theHandler) {

    this.msgTypeToHandlerMap.put(messageType, theHandler);

    LOG.log(Level.FINER, "Add handler for class: {0}", messageType.getCanonicalName());

    return new SubscriptionHandler<>(messageType, this.unsubscribeClass);
  }
670418
protected function resolveHandlingMethod($eventType)
    {
        // Remove namespace
        $pos = strrpos($eventType, '\\');
        if ($pos !== false) {
            $eventType = substr($eventType, $pos + 1);
        }

        // Remove "Event" suffix
        if (substr($eventType, -5) === 'Event') {
            $eventType = substr($eventType, 0, -5);
        }

        return 'on' . $eventType;
    }
11970
private static Map<Method, EventType> findMethods(Class<?> type) {
    Map<Method, EventType> events = new HashMap<>();
    for (Method method : type.getDeclaredMethods()) {
      Event event = method.getAnnotation(Event.class);
      if (event != null) {
        String name = event.value().equals("") ? method.getName() : event.value();
        events.put(method, EventType.from(name));
      }
    }
    for (Class<?> iface : type.getInterfaces()) {
      events.putAll(findMethods(iface));
    }
    return events;
  }
102701
public Object getEventResult() {
		Object result = eventResultCache.get();
		if (result != null) {
			return result;
		}

		if (eventResultHandler != null) {
			result = eventResultHandler.get();
			if (result != null){
				if (!eventResultCache.compareAndSet(null, result)){
					result = eventResultCache.get();
				}
			}
		}
		return result;
	}
92221
public Webhook addEventTypes(final String eventType) {
		if (this.eventTypes == null) {
			this.eventTypes = new ArrayList<String>();
		}
		this.eventTypes.add(eventType);
		return this;
	}
888165
private EnumEventType convertEventToEnum(final EventType<? extends Event> eventType) {

        EnumEventType convertedType = null;

        if (getAnnotationValue() != null && getAnnotationValue().length > 0) {
            // Retrieve all annotation event types
            final EnumEventType[] aTypes = getAnnotationValue()[0].getClass().getEnumConstants();
            // Parse all annotation event types
            for (int i = 0; i < aTypes.length && convertedType == null; i++) {
                // Find the corresponding annotation event type if its javaFX event type matches
                if (aTypes[i].eventType() == eventType) {
                    convertedType = aTypes[i];
                }
            }
        }
        return convertedType;
    }
10759
public static <T extends Event> HandlerRegistration bind(EventTarget target, EventType<T, ?> type,
            EventCallbackFn<T> listener) {
        return bind(target, type.name, e -> listener.onEvent(Js.cast(e)));
    }
1358006
public static Event map(EventType eventType) {
        Event event = new Event();
        event.setEventType(mapEventTypeEnum(eventType.getEventType()));
        Date date = (eventType.getTimestamp() == null)
                ? new Date() : eventType.getTimestamp().toGregorianCalendar().getTime();
        event.setTimestamp(date);
        event.setOriginator(mapOriginatorType(eventType.getOriginator()));
        MessageInfo messageInfo = mapMessageInfo(eventType.getMessageInfo());
        event.setMessageInfo(messageInfo);
        String content = mapContent(eventType.getContent());
        event.setContent(content);
        event.getCustomInfo().clear();
        event.getCustomInfo().putAll(mapCustomInfo(eventType.getCustomInfo()));
        return event;
    }