Recursively finds events defined by the given type and its implemented interfaces.

@param type the type for which to find events
@return the events defined by the given type and its parent interfaces
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;
  }
444250
public List<String> getEventTypes() {
        ArrayList<String> allEvents = new ArrayList<>();
        if (isDelivered()) {
            allEvents.add(MessageEvent.DELIVERED);
        }
        if (!isMessageEventRequest() && isCancelled()) {
            allEvents.add(MessageEvent.CANCELLED);
        }
        if (isComposing()) {
            allEvents.add(MessageEvent.COMPOSING);
        }
        if (isDisplayed()) {
            allEvents.add(MessageEvent.DISPLAYED);
        }
        if (isOffline()) {
            allEvents.add(MessageEvent.OFFLINE);
        }
        return allEvents;
    }
466050
public ClassNode lookupClassNodeFor(String type) {
        for (ClassNode cn : typeCheckingVisitor.getSourceUnit().getAST().getClasses()) {
            if (cn.getName().equals(type))
                return cn;
        }

        return null;
    }
9400
function(type, options) {
    var event = new Base(type, options);
    event.__composed = options && Boolean(options.composed);
    return event;
  }
38085
def find_event_parent_with_event_child(self, parent_name, child_name):
        """"""
        G = self.G
        matches = []
        for n in G.node.keys():
            if G.node[n]['is_event'] and G.node[n]['type'] == parent_name:
                children = G.successors(n)
                for child in children:
                    if G.node[child]['is_event'] and \
                            G.node[child]['type'] == child_name:
                        matches.append((n, child))
                        break
        return list(set(matches))
607670
public <T extends Mapping> T getMapping(MappingType type)
    {
        return (T) mappings.get(type);
    }
884636
public boolean hasEvents(final EventType _eventtype)
    {
        if (!this.eventChecked) {
            this.eventChecked = true;
            try {
                EventDefinition.addEvents(this);
            } catch (final EFapsException e) {
                AbstractAdminObject.LOG.error("Could not read events for Name:; {}', UUID: {}",  this.name, this.uuid);
            }
        }
        return this.events.get(_eventtype) != null;
    }
208945
public List<P> findAllPresentationModelsByType(String type) {
        if (StringUtil.isBlank(type) || !modelsPerType.containsKey(type)) return Collections.emptyList();
        return Collections.unmodifiableList(modelsPerType.get(type));
    }
655063
public static List<Type> getAllTypeArguments(Type javaType) {
        if (!(javaType instanceof ParameterizedType)) {
            return Collections.emptyList();
        }

        return Lists.immutableListOf(((ParameterizedType) javaType).getActualTypeArguments());
    }
882748
private static List<TypeElement> fetchAllNestedTypes(MessageElement type) {
        List<TypeElement> ret = new ArrayList<TypeElement>();

        List<TypeElement> nestedTypes = type.nestedElements();
        ret.addAll(nestedTypes);
        for (TypeElement t : nestedTypes) {
            if (t instanceof MessageElement) {
                List<TypeElement> subNestedTypes = fetchAllNestedTypes((MessageElement) t);
                ret.addAll(subNestedTypes);
            }
        }
        return ret;
    }
1147430
public EventType getType() {
        String typeStr = getTypeString();
        EventType type = null;
        try {
            type = EventType.valueOf(typeStr);
        } catch (Exception ex) {
            logger.warn("Unexpected type: " + typeStr);
        }
        return type;
    }
129306
public static List<Class<?>> resolveHierarchy(final Class<?> type) {
        final List<Class<?>> res = Lists.newArrayList();
        Class<?> current = type;
        while (!Object.class.equals(current) && current != null) {
            res.add(current);
            current = current.getSuperclass();
        }
        return res;
    }
92221
public Webhook addEventTypes(final String eventType) {
		if (this.eventTypes == null) {
			this.eventTypes = new ArrayList<String>();
		}
		this.eventTypes.add(eventType);
		return this;
	}
880137
private List<Event> filterEvents(List<Event> events) {
        List<Event> filteredEvents = new ArrayList<Event>();
        for (Event event : events) {
            if (!filter(event)) {
                filteredEvents.add(event);
            }
        }
        return filteredEvents;
    }
122176
public Event getEvents(int i) {
    if (Document_Type.featOkTst && ((Document_Type)jcasType).casFeat_events == null)
      jcasType.jcas.throwFeatMissing("events", "de.julielab.jules.types.ace.Document");
    jcasType.jcas.checkArrayBounds(jcasType.ll_cas.ll_getRefValue(addr, ((Document_Type)jcasType).casFeatCode_events), i);
    return (Event)(jcasType.ll_cas.ll_getFSForRef(jcasType.ll_cas.ll_getRefArrayValue(jcasType.ll_cas.ll_getRefValue(addr, ((Document_Type)jcasType).casFeatCode_events), i)));}
71335
<T extends EventListener> ArrayList<EventListener> getListeners(Class<T> type) {
        ArrayList<EventListener>    listeners = new ArrayList<EventListener>();
        for (TangoListener tangoListener : tangoListeners) {
            if (tangoListener.type==type) {
                listeners.add(tangoListener.listener);
            }
        }
        return listeners;
    }
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 ());
    }