imageCollector, lineOffset, true, new XmlMessageEmitter(
new XmlSerializer(out)));
} else if (outputFormat == OutputFormat.JSON) {
String callback = null;
errorHandler = new MessageEmitterAdapter(sourceCode, showSource,
imageCollector, lineOffset, true, new JsonMessageEmitter(
new nu.validator.json.Serializer(out), callback));
} else {
throw new RuntimeException("Bug. Should be unreachable.");
}
errorHandler.setErrorsOnly(errorsOnly);