@Test public void testFindAllHandlers_anno() throws Exception { AnnoSub annoSub = new AnnoSub(); Map<Class<? >, Set<EventHandler>> map = new BothHandlerFinder().findAllHandlers(annoSub); assertTrue(map.containsKey(SimpleEvent.class)); Collection<EventHandler> handlers = map.get(SimpleEvent.class); assertTrue(handlers.size() == 1); Iterator<EventHandler> iterator = handlers.iterator(); assertTrue(iterator.hasNext()); EventHandler handler = iterator.next(); try { assertTrue(handler.equals(new EventHandler(annoSub,annoSub.getClass().getMethod(ISubscribe.methodName,SimpleEvent.class)))); } catch (NoSuchMethodException e) { fail(); } }
@Override public Map<Class<?>, Set<EventHandler>> findAllHandlers(Object listener) { Map<Class<?>, Set<EventHandler>> multimap = this.annotatedFinder.findAllHandlers(listener); putAll(multimap,this.listenersFinder.findAllHandlers(listener)); return multimap; }
BothHandlerFinder extends AbstractHandlerFinder { @Override public Map<Class<?>, Set<EventHandler>> findAllHandlers(Object listener) { Map<Class<?>, Set<EventHandler>> multimap = this.annotatedFinder.findAllHandlers(listener); putAll(multimap,this.listenersFinder.findAllHandlers(listener)); return multimap; } }
BothHandlerFinder extends AbstractHandlerFinder { @Override public Map<Class<?>, Set<EventHandler>> findAllHandlers(Object listener) { Map<Class<?>, Set<EventHandler>> multimap = this.annotatedFinder.findAllHandlers(listener); putAll(multimap,this.listenersFinder.findAllHandlers(listener)); return multimap; } BothHandlerFinder(); }
BothHandlerFinder extends AbstractHandlerFinder { @Override public Map<Class<?>, Set<EventHandler>> findAllHandlers(Object listener) { Map<Class<?>, Set<EventHandler>> multimap = this.annotatedFinder.findAllHandlers(listener); putAll(multimap,this.listenersFinder.findAllHandlers(listener)); return multimap; } BothHandlerFinder(); @Override Map<Class<?>, Set<EventHandler>> findAllHandlers(Object listener); @Override AbstractHandlerFinder setStorage(EventStorage storage); }
BothHandlerFinder extends AbstractHandlerFinder { @Override public Map<Class<?>, Set<EventHandler>> findAllHandlers(Object listener) { Map<Class<?>, Set<EventHandler>> multimap = this.annotatedFinder.findAllHandlers(listener); putAll(multimap,this.listenersFinder.findAllHandlers(listener)); return multimap; } BothHandlerFinder(); @Override Map<Class<?>, Set<EventHandler>> findAllHandlers(Object listener); @Override AbstractHandlerFinder setStorage(EventStorage storage);  }