@Test public void create() { HtmlLanguage language = builder.add(BlockType.PARAGRAPH) .add(BlockType.CODE) .add(SpanType.SUPERSCRIPT) .add(SpanType.BOLD) .addSubstitution(SpanType.BOLD, "bold") .name("Test") .create(); assertNotNull(language); assertEquals("Test", language.getName()); assertTrue(language instanceof HtmlSubsetLanguage); HtmlSubsetLanguage subsetLanguage = (HtmlSubsetLanguage) language; assertEquals(ImmutableSet.of(BlockType.PARAGRAPH, BlockType.CODE), subsetLanguage.getSupportedBlockTypes()); assertEquals(ImmutableSet.of(SpanType.SUPERSCRIPT, SpanType.BOLD), subsetLanguage.getSupportedSpanTypes()); assertEquals(0, subsetLanguage.getSupportedHeadingLevel()); }
public HtmlLanguage create() { checkState(name != null, "Name must be provided to create an HtmlLanguage"); return new HtmlSubsetLanguage(name, documentHandler, headingLevel, blockTypes, spanTypes, spanTypeToElementNameSubstitution, spanElementStrategies, xhtmlStrict, supportsImages); }
HtmlLanguageBuilder { public HtmlLanguage create() { checkState(name != null, "Name must be provided to create an HtmlLanguage"); return new HtmlSubsetLanguage(name, documentHandler, headingLevel, blockTypes, spanTypes, spanTypeToElementNameSubstitution, spanElementStrategies, xhtmlStrict, supportsImages); } }
HtmlLanguageBuilder { public HtmlLanguage create() { checkState(name != null, "Name must be provided to create an HtmlLanguage"); return new HtmlSubsetLanguage(name, documentHandler, headingLevel, blockTypes, spanTypes, spanTypeToElementNameSubstitution, spanElementStrategies, xhtmlStrict, supportsImages); } HtmlLanguageBuilder(); }
HtmlLanguageBuilder { public HtmlLanguage create() { checkState(name != null, "Name must be provided to create an HtmlLanguage"); return new HtmlSubsetLanguage(name, documentHandler, headingLevel, blockTypes, spanTypes, spanTypeToElementNameSubstitution, spanElementStrategies, xhtmlStrict, supportsImages); } 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 HtmlLanguage create() { checkState(name != null, "Name must be provided to create an HtmlLanguage"); return new HtmlSubsetLanguage(name, documentHandler, headingLevel, blockTypes, spanTypes, spanTypeToElementNameSubstitution, spanElementStrategies, xhtmlStrict, supportsImages); } 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();  }