DocumentBuilderFactoryBuilder { public DocumentBuilderFactory build() throws ParserConfigurationException { return configure(DocumentBuilderFactory.newInstance()); } DocumentBuilderFactoryBuilder(); static final DocumentBuilderFactoryBuilder newInstance(); static final DocumentBuilderFactoryBuilder newRestrictedInstance(); static final DocumentBuilderFactoryBuilder newInstanceIfNull(DocumentBuilderFactoryBuilder b); static final DocumentBuilderFactoryBuilder newRestrictedInstanceIfNull(DocumentBuilderFactoryBuilder b); static final DocumentBuilderFactoryBuilder newInstanceIfNull(DocumentBuilderFactoryBuilder b, NamespaceContext ctx); DocumentBuilderFactory configure(DocumentBuilderFactory f); DocumentBuilder configure(DocumentBuilder db); DocumentBuilder newDocumentBuilder(DocumentBuilderFactory f); DocumentBuilderFactory build(); DocumentBuilderFactoryBuilder withFeatures(Map<String, Boolean> f); DocumentBuilderFactoryBuilder withFeatures(KeyValuePairSet v); DocumentBuilderFactoryBuilder addFeature(String featureName, Boolean value); DocumentBuilderFactoryBuilder withValidating(Boolean b); DocumentBuilderFactoryBuilder withNamespaceAware(Boolean b); DocumentBuilderFactoryBuilder withNamespaceAware(NamespaceContext b); DocumentBuilderFactoryBuilder withIgnoreWhitespace(Boolean b); DocumentBuilderFactoryBuilder withExpandEntityReferences(Boolean b); DocumentBuilderFactoryBuilder withIgnoreComments(Boolean b); DocumentBuilderFactoryBuilder withCoalescing(Boolean b); DocumentBuilderFactoryBuilder withXIncludeAware(Boolean b); DocumentBuilderFactoryBuilder withEntityResolver(EntityResolver e); static final String DISABLE_DOCTYP; }
@Test public void testBuild() throws Exception { DocumentBuilderFactoryBuilder b = DocumentBuilderFactoryBuilder.newInstance(); assertNotNull(b.build()); assertTrue(DocumentBuilderFactory.class.isAssignableFrom(b.build().getClass())); DocumentBuilderFactory f = b.build(); assertEquals(false, f.isCoalescing()); assertEquals(true, f.isExpandEntityReferences()); assertEquals(false, f.isIgnoringComments()); assertEquals(false, f.isIgnoringElementContentWhitespace()); assertEquals(false, f.isValidating()); assertEquals(true, f.isNamespaceAware()); assertEquals(false, f.isXIncludeAware()); }