if (saxDriverConfig != null && saxDriverConfig.getResource() != null) {
String className = saxDriverConfig.getResource();
reader = XMLReaderFactory.createXMLReader(className);
} else if (source instanceof JavaSource) {
JavaSource javaSource = (JavaSource) source;
if (isFeatureOn(JavaSource.FEATURE_GENERATE_EVENT_STREAM, saxDriverConfig) && !javaSource.isEventStreamRequired()) {
throw new SAXException("Invalid Smooks configuration. Feature '" + JavaSource.FEATURE_GENERATE_EVENT_STREAM + "' is explicitly configured 'on' in the Smooks configuration, while the supplied JavaSource has explicitly configured event streaming to be off (through a call to JavaSource.setEventStreamRequired).");
}
// Event streaming must be explicitly turned off. If is on as long as it is (a) not configured "off" in
// the smooks config (via the reader features) and (b) not turned off via the supplied JavaSource...
boolean eventStreamingOn = (!isFeatureOff(JavaSource.FEATURE_GENERATE_EVENT_STREAM, saxDriverConfig) && javaSource.isEventStreamRequired());
if (eventStreamingOn && javaSource.getSourceObjects() != null) {
reader = new XStreamXMLReader();
} else {
reader = new NullSourceXMLReader();
}
} else {