Ejemplo n.º 1
0
    public boolean hasNext() {
      if (nextProc != null) return true;
      else {
        if (!names.hasNext()) return false;
        else {
          String processorName = names.next();

          Processor processor;
          try {
            try {
              processor = (Processor) (processorCL.loadClass(processorName).newInstance());
            } catch (ClassNotFoundException cnfe) {
              log.error("proc.processor.not.found", processorName);
              return false;
            } catch (ClassCastException cce) {
              log.error("proc.processor.wrong.type", processorName);
              return false;
            } catch (Exception e) {
              log.error("proc.processor.cant.instantiate", processorName);
              return false;
            }
          } catch (ClientCodeException e) {
            throw e;
          } catch (Throwable t) {
            throw new AnnotationProcessingError(t);
          }
          nextProc = processor;
          return true;
        }
      }
    }
Ejemplo n.º 2
0
 /**
  * Run all remaining processors on the procStateList that have not already run this round with
  * an empty set of annotations.
  */
 public void runContributingProcs(RoundEnvironment re) {
   if (!onProcInterator) {
     Set<TypeElement> emptyTypeElements = Collections.emptySet();
     while (innerIter.hasNext()) {
       ProcessorState ps = innerIter.next();
       if (ps.contributed) callProcessor(ps.processor, emptyTypeElements, re);
     }
   }
 }
Ejemplo n.º 3
0
      public ProcessorState next() {
        if (!onProcInterator) {
          if (innerIter.hasNext()) return innerIter.next();
          else onProcInterator = true;
        }

        if (psi.processorIterator.hasNext()) {
          ProcessorState ps =
              new ProcessorState(
                  psi.processorIterator.next(), log, source, JavacProcessingEnvironment.this);
          psi.procStateList.add(ps);
          return ps;
        } else throw new NoSuchElementException();
      }
Ejemplo n.º 4
0
 public boolean hasNext() {
   try {
     return iterator.hasNext();
   } catch (Throwable t) {
     if ("ServiceConfigurationError".equals(t.getClass().getSimpleName())) {
       log.error("proc.bad.config.file", t.getLocalizedMessage());
     }
     throw new Abort(t);
   }
 }
Ejemplo n.º 5
0
 public Processor next() {
   try {
     return (Processor) (iterator.next());
   } catch (Throwable t) {
     if ("ServiceConfigurationError".equals(t.getClass().getSimpleName())) {
       log.error("proc.bad.config.file", t.getLocalizedMessage());
     } else {
       log.error("proc.processor.constructor.error", t.getLocalizedMessage());
     }
     throw new Abort(t);
   }
 }
Ejemplo n.º 6
0
 public boolean hasNext() {
   if (onProcInterator) return psi.processorIterator.hasNext();
   else return innerIter.hasNext() || psi.processorIterator.hasNext();
 }