/** * Creates a pooling Parser with the given options, using the global DocumentBuilder pool. * * @param options * the options. * @return DOMParser. */ public static DOMParser createPoolingParser(final DOMParserOptions options) { return new PoolingDOMParser(options != null ? options : DOMParserOptions.getDefault(), getDocumentBuilderPool()); }
/** * Creates a pooling Parser with the given options, which uses the given document builder pool. * * @return DOMParser. */ public static DOMParser createPoolingParser(final DOMParserOptions options, final DocumentBuilderPool pool) { return new PoolingDOMParser(options != null ? options : DOMParserOptions.getDefault(), pool != null ? pool : getDocumentBuilderPool()); }
public static Document createEmptyDocument(final DOMParserOptions options) { DOMParserOptions opts = options != null ? options : DOMParserOptions.getDefault(); DocumentBuilderPool pool = getDocumentBuilderPool(); DocumentBuilder builder = pool.acquire(opts); try { return builder.newDocument(); } finally { pool.release(builder, opts); } }