@Test public void testNoHandlers() { List<String> log = new ArrayList<String>(); HandlerChainImpl chain = new HandlerChainImpl( null, TestAnnotationHandler.class, Collections.<AnnotationHandler<Annotation>> emptyList()); chain.proceed(); assertEquals(0, log.size()); }
@Override public void proceed() { if (pos < handlers.size()) { AnnotationHandler<Annotation> handler = handlers.get(pos++); Annotation annotation = element.getAnnotation(handler.handles()); Assert.notNull(annotation, "Could not find annotation [" + handler.handles().getName() + "] on: " + element); handler.process(context, annotation, this); } }
HandlerChainImpl implements HandlerChain { @Override public void proceed() { if (pos < handlers.size()) { AnnotationHandler<Annotation> handler = handlers.get(pos++); Annotation annotation = element.getAnnotation(handler.handles()); Assert.notNull(annotation, "Could not find annotation [" + handler.handles().getName() + "] on: " + element); handler.process(context, annotation, this); } } }
HandlerChainImpl implements HandlerChain { @Override public void proceed() { if (pos < handlers.size()) { AnnotationHandler<Annotation> handler = handlers.get(pos++); Annotation annotation = element.getAnnotation(handler.handles()); Assert.notNull(annotation, "Could not find annotation [" + handler.handles().getName() + "] on: " + element); handler.process(context, annotation, this); } } @SuppressWarnings("unchecked")  HandlerChainImpl(ClassContext context, AnnotatedElement element, List<? extends AnnotationHandler<?>> handlers); }
HandlerChainImpl implements HandlerChain { @Override public void proceed() { if (pos < handlers.size()) { AnnotationHandler<Annotation> handler = handlers.get(pos++); Annotation annotation = element.getAnnotation(handler.handles()); Assert.notNull(annotation, "Could not find annotation [" + handler.handles().getName() + "] on: " + element); handler.process(context, annotation, this); } } @SuppressWarnings("unchecked")  HandlerChainImpl(ClassContext context, AnnotatedElement element, List<? extends AnnotationHandler<?>> handlers); @Override void proceed(); }
HandlerChainImpl implements HandlerChain { @Override public void proceed() { if (pos < handlers.size()) { AnnotationHandler<Annotation> handler = handlers.get(pos++); Annotation annotation = element.getAnnotation(handler.handles()); Assert.notNull(annotation, "Could not find annotation [" + handler.handles().getName() + "] on: " + element); handler.process(context, annotation, this); } } @SuppressWarnings("unchecked")  HandlerChainImpl(ClassContext context, AnnotatedElement element, List<? extends AnnotationHandler<?>> handlers); @Override void proceed();  }