@Test public void createDocumentBuilder() { StringWriter out = new StringWriter(); HtmlSubsetDocumentBuilder builder = newHtmlSubsetLanguage(BlockType.PARAGRAPH).createDocumentBuilder(out, false); assertNotNull(builder); assertTrue(builder instanceof HtmlSubsetDocumentBuilder); builder = newHtmlSubsetLanguage(SpanType.EMPHASIS).createDocumentBuilder(out, false); builder.beginSpan(SpanType.EMPHASIS, new Attributes()); builder.characters("text"); builder.endSpan(); assertEquals("<new-em>text</new-em>", out.toString()); }
@Override public HtmlSubsetDocumentBuilder createDocumentBuilder(Writer out, boolean formatting) { HtmlSubsetDocumentBuilder builder = new HtmlSubsetDocumentBuilder(out, formatting); builder.setSupportedHeadingLevel(headingLevel); builder.setSupportedSpanTypes(supportedSpanTypes, spanElementStrategies); builder.setSupportedBlockTypes(supportedBlockTypes); builder.setXhtmlStrict(xhtmlStrict); builder.setSupportsImages(supportsImages); addSpanTagNameSubstitutions(builder); if (documentHandler != null) { builder.setDocumentHandler(documentHandler); } return builder; }
HtmlSubsetLanguage extends HtmlLanguage { @Override public HtmlSubsetDocumentBuilder createDocumentBuilder(Writer out, boolean formatting) { HtmlSubsetDocumentBuilder builder = new HtmlSubsetDocumentBuilder(out, formatting); builder.setSupportedHeadingLevel(headingLevel); builder.setSupportedSpanTypes(supportedSpanTypes, spanElementStrategies); builder.setSupportedBlockTypes(supportedBlockTypes); builder.setXhtmlStrict(xhtmlStrict); builder.setSupportsImages(supportsImages); addSpanTagNameSubstitutions(builder); if (documentHandler != null) { builder.setDocumentHandler(documentHandler); } return builder; } }
HtmlSubsetLanguage extends HtmlLanguage { @Override public HtmlSubsetDocumentBuilder createDocumentBuilder(Writer out, boolean formatting) { HtmlSubsetDocumentBuilder builder = new HtmlSubsetDocumentBuilder(out, formatting); builder.setSupportedHeadingLevel(headingLevel); builder.setSupportedSpanTypes(supportedSpanTypes, spanElementStrategies); builder.setSupportedBlockTypes(supportedBlockTypes); builder.setXhtmlStrict(xhtmlStrict); builder.setSupportsImages(supportsImages); addSpanTagNameSubstitutions(builder); if (documentHandler != null) { builder.setDocumentHandler(documentHandler); } return builder; } HtmlSubsetLanguage(String name, HtmlDocumentHandler documentHandler, int headingLevel,
			Set<BlockType> blockTypes, Set<SpanType> spanTypes, Map<SpanType, String> tagNameSubstitutions,
			List<SpanHtmlElementStrategy> spanElementStrategies, boolean xhtmlStrict, boolean supportsImages); }
HtmlSubsetLanguage extends HtmlLanguage { @Override public HtmlSubsetDocumentBuilder createDocumentBuilder(Writer out, boolean formatting) { HtmlSubsetDocumentBuilder builder = new HtmlSubsetDocumentBuilder(out, formatting); builder.setSupportedHeadingLevel(headingLevel); builder.setSupportedSpanTypes(supportedSpanTypes, spanElementStrategies); builder.setSupportedBlockTypes(supportedBlockTypes); builder.setXhtmlStrict(xhtmlStrict); builder.setSupportsImages(supportsImages); addSpanTagNameSubstitutions(builder); if (documentHandler != null) { builder.setDocumentHandler(documentHandler); } return builder; } HtmlSubsetLanguage(String name, HtmlDocumentHandler documentHandler, int headingLevel,
			Set<BlockType> blockTypes, Set<SpanType> spanTypes, Map<SpanType, String> tagNameSubstitutions,
			List<SpanHtmlElementStrategy> spanElementStrategies, boolean xhtmlStrict, boolean supportsImages); Set<BlockType> getSupportedBlockTypes(); Set<SpanType> getSupportedSpanTypes(); int getSupportedHeadingLevel(); Map<SpanType, String> getTagNameSubstitutions(); @Override HtmlSubsetDocumentBuilder createDocumentBuilder(Writer out, boolean formatting); @Override HtmlSubsetLanguage clone(); boolean isXhtmlStrict(); boolean getSupportsImages(); }
HtmlSubsetLanguage extends HtmlLanguage { @Override public HtmlSubsetDocumentBuilder createDocumentBuilder(Writer out, boolean formatting) { HtmlSubsetDocumentBuilder builder = new HtmlSubsetDocumentBuilder(out, formatting); builder.setSupportedHeadingLevel(headingLevel); builder.setSupportedSpanTypes(supportedSpanTypes, spanElementStrategies); builder.setSupportedBlockTypes(supportedBlockTypes); builder.setXhtmlStrict(xhtmlStrict); builder.setSupportsImages(supportsImages); addSpanTagNameSubstitutions(builder); if (documentHandler != null) { builder.setDocumentHandler(documentHandler); } return builder; } HtmlSubsetLanguage(String name, HtmlDocumentHandler documentHandler, int headingLevel,
			Set<BlockType> blockTypes, Set<SpanType> spanTypes, Map<SpanType, String> tagNameSubstitutions,
			List<SpanHtmlElementStrategy> spanElementStrategies, boolean xhtmlStrict, boolean supportsImages); Set<BlockType> getSupportedBlockTypes(); Set<SpanType> getSupportedSpanTypes(); int getSupportedHeadingLevel(); Map<SpanType, String> getTagNameSubstitutions(); @Override HtmlSubsetDocumentBuilder createDocumentBuilder(Writer out, boolean formatting); @Override HtmlSubsetLanguage clone(); boolean isXhtmlStrict(); boolean getSupportsImages();  }