Beispiel #1
0
 public ParamHandlerChain(Set<ParamAnnotationHandler> handlers, Annotation[] anns) {
   set = new HashSet<ParamAnnotationHandler>();
   for (ParamAnnotationHandler ah : handlers) {
     if (ah.canHandle(anns)) {
       set.add(ah);
     }
   }
 }
Beispiel #2
0
 public ParamAnnotationHandler next() {
   if (current == null) {
     ParamAnnotationHandler ret = EmptyHandler.getInstance();
     for (ParamAnnotationHandler ah : set) {
       if (ah.priority() < ret.priority()) {
         ret = ah;
       }
     }
     current = ret;
     return ret;
   }
   ParamAnnotationHandler ret = EmptyHandler.getInstance();
   for (ParamAnnotationHandler ah : set) {
     if (ah.priority() < ret.priority() && ah.priority() > current.priority()) {
       ret = ah;
     }
   }
   current = ret;
   return ret;
 }