if (streamAnnotatingProcess != null) {
throw new IllegalStateException(
"Cannot restart a recorder that has already been started.");
}
SAXRecorderFactory factory = SAXRecorderFactory.getDefaultInstance();
SAXRecorderConfiguration configuration =
factory.createSAXRecorderConfiguration();
configuration.setRecordPerEventLocation(true);
recorder = factory.createSAXRecorder(configuration);
recordingHandler = recorder.getContentHandler();
if (pipeline != null) {
XMLProcess cap = new ContextAnnotatingProcess(true);
cap.setPipeline(pipeline);