@Test public void document() { HtmlSubsetLanguage subsetLanguage = (HtmlSubsetLanguage) builder.add(BlockType.PARAGRAPH) .document("<div>", "</div>") .name("Test") .create(); StringWriter writer = new StringWriter(); DocumentBuilder documentBuilder = subsetLanguage.createDocumentBuilder(writer); documentBuilder.beginDocument(); documentBuilder.characters("test"); documentBuilder.endDocument(); assertEquals("<div>test</div>", writer.toString()); }
public HtmlLanguageBuilder document(String prefix, String suffix) { requireNonNull(prefix, "Must provide a prefix"); requireNonNull(suffix, "Must provide a suffix"); documentHandler = new LiteralHtmlDocumentHandler(prefix, suffix); return this; }
HtmlLanguageBuilder { public HtmlLanguageBuilder document(String prefix, String suffix) { requireNonNull(prefix, "Must provide a prefix"); requireNonNull(suffix, "Must provide a suffix"); documentHandler = new LiteralHtmlDocumentHandler(prefix, suffix); return this; } }
HtmlLanguageBuilder { public HtmlLanguageBuilder document(String prefix, String suffix) { requireNonNull(prefix, "Must provide a prefix"); requireNonNull(suffix, "Must provide a suffix"); documentHandler = new LiteralHtmlDocumentHandler(prefix, suffix); return this; } HtmlLanguageBuilder(); }
HtmlLanguageBuilder { public HtmlLanguageBuilder document(String prefix, String suffix) { requireNonNull(prefix, "Must provide a prefix"); requireNonNull(suffix, "Must provide a suffix"); documentHandler = new LiteralHtmlDocumentHandler(prefix, suffix); return this; } HtmlLanguageBuilder(); HtmlLanguageBuilder name(String name); HtmlLanguageBuilder add(BlockType blockType); HtmlLanguageBuilder add(SpanType spanType); HtmlLanguageBuilder addSubstitution(SpanType spanType, String alternativeTagName); HtmlLanguageBuilder addHeadings(int level); HtmlLanguageBuilder addSpanFont(); HtmlLanguageBuilder setXhtmlStrict(boolean xhtmlStrict); HtmlLanguageBuilder document(String prefix, String suffix); HtmlLanguageBuilder setSupportsImages(boolean supportsImages); HtmlLanguage create(); }
HtmlLanguageBuilder { public HtmlLanguageBuilder document(String prefix, String suffix) { requireNonNull(prefix, "Must provide a prefix"); requireNonNull(suffix, "Must provide a suffix"); documentHandler = new LiteralHtmlDocumentHandler(prefix, suffix); return this; } HtmlLanguageBuilder(); HtmlLanguageBuilder name(String name); HtmlLanguageBuilder add(BlockType blockType); HtmlLanguageBuilder add(SpanType spanType); HtmlLanguageBuilder addSubstitution(SpanType spanType, String alternativeTagName); HtmlLanguageBuilder addHeadings(int level); HtmlLanguageBuilder addSpanFont(); HtmlLanguageBuilder setXhtmlStrict(boolean xhtmlStrict); HtmlLanguageBuilder document(String prefix, String suffix); HtmlLanguageBuilder setSupportsImages(boolean supportsImages); HtmlLanguage create();  }