/** * Initializes the pool with a new set of configuration options. * * @throws XMLParserException thrown if there is a problem initialzing the pool */ protected synchronized void initializePool() throws XMLParserException { if (!dirtyBuilderConfiguration) { // in case the pool was initialized by some other thread return; } DocumentBuilderFactory newFactory = DocumentBuilderFactory.newInstance(); setAttributes(newFactory, builderAttributes); setFeatures(newFactory, builderFeatures); newFactory.setCoalescing(coalescing); newFactory.setExpandEntityReferences(expandEntityReferences); newFactory.setIgnoringComments(ignoreComments); newFactory.setIgnoringElementContentWhitespace(ignoreElementContentWhitespace); newFactory.setNamespaceAware(namespaceAware); newFactory.setSchema(schema); newFactory.setValidating(dtdValidating); newFactory.setXIncludeAware(xincludeAware); poolVersion++; dirtyBuilderConfiguration = false; builderFactory = newFactory; builderPool.clear(); }
/** * Initializes the pool with a new set of configuration options. * * @throws XMLParserException thrown if there is a problem initialzing the pool */ protected synchronized void initializePool() throws XMLParserException { if (!dirtyBuilderConfiguration) { // in case the pool was initialized by some other thread return; } DocumentBuilderFactory newFactory = DocumentBuilderFactory.newInstance(); setAttributes(newFactory, builderAttributes); setFeatures(newFactory, builderFeatures); newFactory.setCoalescing(coalescing); newFactory.setExpandEntityReferences(expandEntityReferences); newFactory.setIgnoringComments(ignoreComments); newFactory.setIgnoringElementContentWhitespace(ignoreElementContentWhitespace); newFactory.setNamespaceAware(namespaceAware); newFactory.setSchema(schema); newFactory.setValidating(dtdValidating); newFactory.setXIncludeAware(xincludeAware); poolVersion++; dirtyBuilderConfiguration = false; builderFactory = newFactory; builderPool.clear(); }