/** {@inheritDoc} */ public DocumentBuilder getBuilder() throws XMLParserException { DocumentBuilder builder = null; if (!initialized) { throw new XMLParserException("Parser pool has not been initialized"); } synchronized(builderPool) { if (!builderPool.isEmpty()) { builder = builderPool.pop().get(); } } // Will be null if either the stack was empty, or the SoftReference // has been garbage-collected if (builder == null) { builder = createBuilder(); } if (builder != null) { return new DocumentBuilderProxy(builder, this); } return null; }
/** {@inheritDoc} */ public Document parse(File f) throws SAXException, IOException { checkValidState(); return builder.parse(f); }
if (proxiedBuilder.getOwningPool() != this) { return; if (proxiedBuilder.isReturned()) { return; proxiedBuilder.setReturned(true); DocumentBuilder unwrappedBuilder = proxiedBuilder.getProxiedBuilder(); unwrappedBuilder.reset(); SoftReference<DocumentBuilder> builderReference = new SoftReference<DocumentBuilder>(unwrappedBuilder);
if (proxiedBuilder.getOwningPool() != this) { return; if (proxiedBuilder.isReturned()) { return; proxiedBuilder.setReturned(true); DocumentBuilder unwrappedBuilder = proxiedBuilder.getProxiedBuilder(); unwrappedBuilder.reset(); SoftReference<DocumentBuilder> builderReference = new SoftReference<DocumentBuilder>(unwrappedBuilder);
/** {@inheritDoc} */ public DocumentBuilder getBuilder() throws XMLParserException { DocumentBuilder builder = null; if (!initialized) { throw new XMLParserException("Parser pool has not been initialized"); } synchronized(builderPool) { if (!builderPool.isEmpty()) { builder = builderPool.pop().get(); } } // Will be null if either the stack was empty, or the SoftReference // has been garbage-collected if (builder == null) { builder = createBuilder(); } if (builder != null) { return new DocumentBuilderProxy(builder, this); } return null; }
/** {@inheritDoc} */ public void setErrorHandler(ErrorHandler eh) { checkValidState(); return; }
/** {@inheritDoc} */ public void setEntityResolver(EntityResolver er) { checkValidState(); return; }
/** {@inheritDoc} */ public DOMImplementation getDOMImplementation() { checkValidState(); return builder.getDOMImplementation(); }
/** {@inheritDoc} */ public Document parse(String uri) throws SAXException, IOException { checkValidState(); return builder.parse(uri); }
/** {@inheritDoc} */ public Document parse(InputStream is, String systemId) throws SAXException, IOException { checkValidState(); return builder.parse(is, systemId); }
/** {@inheritDoc} */ public boolean isXIncludeAware() { checkValidState(); return builder.isXIncludeAware(); }
/** {@inheritDoc} */ public boolean isNamespaceAware() { checkValidState(); return builder.isNamespaceAware(); }
/** {@inheritDoc} */ public DOMImplementation getDOMImplementation() { checkValidState(); return builder.getDOMImplementation(); }
/** {@inheritDoc} */ public Document newDocument() { checkValidState(); return builder.newDocument(); }
/** {@inheritDoc} */ public boolean isValidating() { checkValidState(); return builder.isValidating(); }
/** {@inheritDoc} */ public Schema getSchema() { checkValidState(); return builder.getSchema(); }
/** {@inheritDoc} */ public void setErrorHandler(ErrorHandler eh) { checkValidState(); return; }
/** {@inheritDoc} */ public Document parse(File f) throws SAXException, IOException { checkValidState(); return builder.parse(f); }
/** {@inheritDoc} */ public boolean isValidating() { checkValidState(); return builder.isValidating(); }
/** {@inheritDoc} */ public Schema getSchema() { checkValidState(); return builder.getSchema(); }