/** * Returns the event type given the implementation class. * * @param eventClass The event class. * @return The corresponding event type, or null if none. */ public static String getEventType(Class<? extends Event> eventClass) { return EventTypeScanner.getInstance().getEventType(eventClass); }
/** * Returns the implementation class for the specified event type. If there is no implementation * specific to the event type, the Event class will be returned. * * @param eventType The event type (with or without the "on" prefix). * @return The implementation class for the event type (never null). */ public static Class<? extends Event> getEventClass(String eventType) { return EventTypeScanner.getInstance().getEventClass(stripOn(eventType)); }
public ServletConfiguration() { ComponentScanner.getInstance().scanPackage(BaseComponent.class.getPackage()); EventTypeScanner.getInstance().scanPackage(Event.class.getPackage()); }
/** * Creates mapping between event type and its implementation class. * * @param eventClass Class containing EventType annotation. */ @Override protected void doScanClass(Class<Event> eventClass) { typeToClass.put(getEventType(eventClass), eventClass); }