Search in sources :

Example 1 with VALIDATION_SETTING

use of org.exist.util.XMLReaderObjectFactory.VALIDATION_SETTING in project exist by eXist-db.

the class MutableCollection method releaseReader.

/**
 * Reset validation mode of reader and return reader to reader pool.
 *
 * @param broker The database broker
 * @param reader The XML Reader to release
 */
private void releaseReader(final DBBroker broker, final XMLReader reader) {
    // Get validation mode from static configuration
    final Configuration config = broker.getConfiguration();
    final String optionValue = (String) config.getProperty(XMLReaderObjectFactory.PROPERTY_VALIDATION_MODE);
    final VALIDATION_SETTING validationMode = XMLReaderObjectFactory.VALIDATION_SETTING.fromOption(optionValue);
    // Restore default validation mode
    XMLReaderObjectFactory.setReaderValidationMode(validationMode, reader);
    // Return reader
    broker.getBrokerPool().getParserPool().returnXMLReader(reader);
}
Also used : Configuration(org.exist.util.Configuration) VALIDATION_SETTING(org.exist.util.XMLReaderObjectFactory.VALIDATION_SETTING)

Aggregations

Configuration (org.exist.util.Configuration)1 VALIDATION_SETTING (org.exist.util.XMLReaderObjectFactory.VALIDATION_SETTING)1