/** * Constructor. * * @param retainXML whether to retain the XML configuration elements within the {@link Configuration}. * * @throws ConfigurationException thrown if the validation schema for configuration files can not be created * * @deprecated this method will be removed once {@link Configuration} no longer has the option to store the XML configuration fragements */ public XMLConfigurator(boolean retainXML) throws ConfigurationException { retainXMLConfiguration = retainXML; parserPool = new BasicParserPool(); SchemaFactory factory = SchemaFactory.newInstance(javax.xml.XMLConstants.W3C_XML_SCHEMA_NS_URI); Source schemaSource = new StreamSource(XMLConfigurator.class .getResourceAsStream(XMLConstants.XMLTOOLING_SCHEMA_LOCATION)); try { configurationSchema = factory.newSchema(schemaSource); parserPool.setIgnoreComments(true); parserPool.setIgnoreElementContentWhitespace(true); parserPool.setSchema(configurationSchema); } catch (SAXException e) { throw new ConfigurationException("Unable to read XMLTooling configuration schema", e); } }
/** * Constructor. * * @param retainXML whether to retain the XML configuration elements within the {@link Configuration}. * * @throws ConfigurationException thrown if the validation schema for configuration files can not be created * * @deprecated this method will be removed once {@link Configuration} no longer has the option to store the XML configuration fragements */ public XMLConfigurator(boolean retainXML) throws ConfigurationException { retainXMLConfiguration = retainXML; parserPool = new BasicParserPool(); SchemaFactory factory = SchemaFactory.newInstance(javax.xml.XMLConstants.W3C_XML_SCHEMA_NS_URI); Source schemaSource = new StreamSource(XMLConfigurator.class .getResourceAsStream(XMLConstants.XMLTOOLING_SCHEMA_LOCATION)); try { configurationSchema = factory.newSchema(schemaSource); parserPool.setIgnoreComments(true); parserPool.setIgnoreElementContentWhitespace(true); parserPool.setSchema(configurationSchema); } catch (SAXException e) { throw new ConfigurationException("Unable to read XMLTooling configuration schema", e); } }