use of spoon.processing.Processor in project spoon by INRIA.
the class QueueProcessingManager method process.
public void process(Collection<? extends CtElement> elements) {
Processor<?> p;
// copy so that one can reuse the processing manager
// among different processing steps
Queue<Processor<?>> processors = new LinkedList<>(getProcessors());
while ((p = processors.poll()) != null) {
try {
getFactory().getEnvironment().reportProgressMessage(p.getClass().getName());
current = p;
// load the properties
p.init();
p.process();
for (CtElement e : new ArrayList<>(elements)) {
getVisitor().setProcessor(p);
getVisitor().scan(e);
}
} catch (ProcessInterruption ignore) {
} finally {
p.processingDone();
}
}
}
Aggregations