use of spoon.processing.ProcessInterruption 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();
}
}
}
use of spoon.processing.ProcessInterruption in project spoon by INRIA.
the class RuntimeProcessingManager method process.
/**
* Recursively processes elements and their children with a given processor.
*/
public void process(Collection<? extends CtElement> elements, Processor<?> processor) {
try {
getFactory().getEnvironment().debugMessage("processing with '" + processor.getClass().getName() + "'...");
current = processor;
Timer.start(processor.getClass().getName());
for (CtElement e : elements) {
process(e, processor);
}
Timer.stop(processor.getClass().getName());
} catch (ProcessInterruption ignored) {
}
}
Aggregations