@Test public void setElementNameOfSpanTypeRequiresSpanType() { NullPointerException e = assertThrows(NullPointerException.class, () -> builder.setElementNameOfSpanType(null, "some-name")); assertTrue(e.getMessage().contains("Must provide spanType")); }
public void setElementNameOfSpanType(SpanType spanType, String elementName) { Objects.requireNonNull(spanType, "Must provide spanType"); Objects.requireNonNull(elementName, "Must provide elementName"); ImmutableMap.Builder<SpanType, String> builder = ImmutableMap.builder(); for (Entry<SpanType, String> entry : spanTypeToElementName.entrySet()) { if (!entry.getKey().equals(spanType)) { builder.put(entry); } } builder.put(spanType, elementName); spanTypeToElementName = builder.build(); }
HtmlDocumentBuilder extends AbstractXmlDocumentBuilder { public void setElementNameOfSpanType(SpanType spanType, String elementName) { Objects.requireNonNull(spanType, "Must provide spanType"); Objects.requireNonNull(elementName, "Must provide elementName"); ImmutableMap.Builder<SpanType, String> builder = ImmutableMap.builder(); for (Entry<SpanType, String> entry : spanTypeToElementName.entrySet()) { if (!entry.getKey().equals(spanType)) { builder.put(entry); } } builder.put(spanType, elementName); spanTypeToElementName = builder.build(); } }
HtmlDocumentBuilder extends AbstractXmlDocumentBuilder { public void setElementNameOfSpanType(SpanType spanType, String elementName) { Objects.requireNonNull(spanType, "Must provide spanType"); Objects.requireNonNull(elementName, "Must provide elementName"); ImmutableMap.Builder<SpanType, String> builder = ImmutableMap.builder(); for (Entry<SpanType, String> entry : spanTypeToElementName.entrySet()) { if (!entry.getKey().equals(spanType)) { builder.put(entry); } } builder.put(spanType, elementName); spanTypeToElementName = builder.build(); } HtmlDocumentBuilder(Writer out);  HtmlDocumentBuilder(Writer out, boolean formatting);  HtmlDocumentBuilder(XmlStreamWriter writer); }
HtmlDocumentBuilder extends AbstractXmlDocumentBuilder { public void setElementNameOfSpanType(SpanType spanType, String elementName) { Objects.requireNonNull(spanType, "Must provide spanType"); Objects.requireNonNull(elementName, "Must provide elementName"); ImmutableMap.Builder<SpanType, String> builder = ImmutableMap.builder(); for (Entry<SpanType, String> entry : spanTypeToElementName.entrySet()) { if (!entry.getKey().equals(spanType)) { builder.put(entry); } } builder.put(spanType, elementName); spanTypeToElementName = builder.build(); } HtmlDocumentBuilder(Writer out);  HtmlDocumentBuilder(Writer out, boolean formatting);  HtmlDocumentBuilder(XmlStreamWriter writer); void copyConfiguration(HtmlDocumentBuilder other); void addLinkUriProcessor(UriProcessor processor); void setElementNameOfSpanType(SpanType spanType, String elementName); String getHtmlNsUri(); void setHtmlNsUri(String htmlNsUri); String getHtmlDtd(); void setHtmlDtd(String htmlDtd); boolean isEmitAsDocument(); void setEmitAsDocument(boolean emitAsDocument); boolean isEmitDtd(); void setEmitDtd(boolean emitDtd); String getEncoding(); void setEncoding(String encoding); String getTitle(); void setTitle(String title); String getDefaultAbsoluteLinkTarget(); void setDefaultAbsoluteLinkTarget(String defaultAbsoluteLinkTarget); boolean isXhtmlStrict(); void setXhtmlStrict(boolean xhtmlStrict); @Deprecated void addCssStylesheet(String url); @Deprecated void addCssStylesheet(File file); void addCssStylesheet(Stylesheet stylesheet); boolean isUseInlineStyles(); void setUseInlineStyles(boolean useInlineStyles); boolean isSuppressBuiltInStyles(); void setSuppressBuiltInStyles(boolean suppressBuiltInStyles); String getLinkRel(); void setLinkRel(String linkRel); void setDocumentHandler(HtmlDocumentHandler documentHandler); @Override void beginDocument(); @Override void endDocument(); @Override void entityReference(String entity); @Override void acronym(String text, String definition); @Override void link(Attributes attributes, String hrefOrHashName, String text); @Override void beginBlock(BlockType type, Attributes attributes); @Override void beginHeading(int level, Attributes attributes); @Override void beginSpan(SpanType type, Attributes attributes); @Override void endBlock(); @Override void endHeading(); @Override void endSpan(); @Override void image(Attributes attributes, String url); @Override void imageLink(Attributes linkAttributes, Attributes imageAttributes, String href, String imageUrl); String getHtmlFilenameFormat(); void setHtmlFilenameFormat(String htmlFilenameFormat); @Override void lineBreak(); @Override void horizontalRule(); @Override void charactersUnescaped(String literal); void setPrependImagePrefix(String prependImagePrefix); String getPrependImagePrefix(); boolean isFilterEntityReferences(); void setFilterEntityReferences(boolean filterEntityReferences); String getCopyrightNotice(); void setCopyrightNotice(String copyrightNotice); }
HtmlDocumentBuilder extends AbstractXmlDocumentBuilder { public void setElementNameOfSpanType(SpanType spanType, String elementName) { Objects.requireNonNull(spanType, "Must provide spanType"); Objects.requireNonNull(elementName, "Must provide elementName"); ImmutableMap.Builder<SpanType, String> builder = ImmutableMap.builder(); for (Entry<SpanType, String> entry : spanTypeToElementName.entrySet()) { if (!entry.getKey().equals(spanType)) { builder.put(entry); } } builder.put(spanType, elementName); spanTypeToElementName = builder.build(); } HtmlDocumentBuilder(Writer out);  HtmlDocumentBuilder(Writer out, boolean formatting);  HtmlDocumentBuilder(XmlStreamWriter writer); void copyConfiguration(HtmlDocumentBuilder other); void addLinkUriProcessor(UriProcessor processor); void setElementNameOfSpanType(SpanType spanType, String elementName); String getHtmlNsUri(); void setHtmlNsUri(String htmlNsUri); String getHtmlDtd(); void setHtmlDtd(String htmlDtd); boolean isEmitAsDocument(); void setEmitAsDocument(boolean emitAsDocument); boolean isEmitDtd(); void setEmitDtd(boolean emitDtd); String getEncoding(); void setEncoding(String encoding); String getTitle(); void setTitle(String title); String getDefaultAbsoluteLinkTarget(); void setDefaultAbsoluteLinkTarget(String defaultAbsoluteLinkTarget); boolean isXhtmlStrict(); void setXhtmlStrict(boolean xhtmlStrict); @Deprecated void addCssStylesheet(String url); @Deprecated void addCssStylesheet(File file); void addCssStylesheet(Stylesheet stylesheet); boolean isUseInlineStyles(); void setUseInlineStyles(boolean useInlineStyles); boolean isSuppressBuiltInStyles(); void setSuppressBuiltInStyles(boolean suppressBuiltInStyles); String getLinkRel(); void setLinkRel(String linkRel); void setDocumentHandler(HtmlDocumentHandler documentHandler); @Override void beginDocument(); @Override void endDocument(); @Override void entityReference(String entity); @Override void acronym(String text, String definition); @Override void link(Attributes attributes, String hrefOrHashName, String text); @Override void beginBlock(BlockType type, Attributes attributes); @Override void beginHeading(int level, Attributes attributes); @Override void beginSpan(SpanType type, Attributes attributes); @Override void endBlock(); @Override void endHeading(); @Override void endSpan(); @Override void image(Attributes attributes, String url); @Override void imageLink(Attributes linkAttributes, Attributes imageAttributes, String href, String imageUrl); String getHtmlFilenameFormat(); void setHtmlFilenameFormat(String htmlFilenameFormat); @Override void lineBreak(); @Override void horizontalRule(); @Override void charactersUnescaped(String literal); void setPrependImagePrefix(String prependImagePrefix); String getPrependImagePrefix(); boolean isFilterEntityReferences(); void setFilterEntityReferences(boolean filterEntityReferences); String getCopyrightNotice(); void setCopyrightNotice(String copyrightNotice);  }