Class HtmlTagWriter
java.lang.Object
com.atlassian.plugin.webresource.assembler.html.HtmlTagWriter
- Direct Known Subclasses:
InlineHtmlTagWriter,PrefetchHtmlTagWriter
Represents a
Writer wrapper responsible for writing WebResourceInformation.getResourceUrls() as HTML tags, according to their extension.- Since:
- 5.0.0
-
Constructor Summary
ConstructorsConstructorDescriptionHtmlTagWriter(RequestState requestState, Writer writer, Collection<com.atlassian.plugin.webresource.assembler.html.HtmlTagFormatter> formatters) -
Method Summary
Modifier and TypeMethodDescriptionvoidwriteHtmlTag(WebResourceInformation information, Predicate<WebResource> predicate, Predicate<ResourceUrl> legacyPredicate) Generates HTML import tags for eachWebResourceInformation.getResourceUrls()according to its URL extension type and write it into thewriter.protected voidwriteHtmlTag(String... html) Flushes an HTML string to the writer.voidwriteHtmlTag(Collection<ResourceUrls> resources) Generates HTML tags for eachResourceUrlsaccording to its URL extension type and write it into thewriter.
-
Constructor Details
-
HtmlTagWriter
public HtmlTagWriter(@Nonnull RequestState requestState, @Nonnull Writer writer, @Nonnull Collection<com.atlassian.plugin.webresource.assembler.html.HtmlTagFormatter> formatters)
-
-
Method Details
-
writeHtmlTag
public void writeHtmlTag(@Nonnull WebResourceInformation information, @Nonnull Predicate<WebResource> predicate, @Nonnull Predicate<ResourceUrl> legacyPredicate) Generates HTML import tags for eachWebResourceInformation.getResourceUrls()according to its URL extension type and write it into thewriter.- Parameters:
information- The information used to generate the import tags.predicate- The predicate used to filter the resources based on theWebResourceinformation.legacyPredicate- The predicate used to filter the resources based on theResourceUrlinformation.
-
writeHtmlTag
Generates HTML tags for eachResourceUrlsaccording to its URL extension type and write it into thewriter.- Parameters:
resources- The resources containing the URL information to be used to generate HTML import tag.
-
writeHtmlTag
Flushes an HTML string to the writer. Use when you need to optimise how HTML is rendered for a collection of resources rather than a single one.- Parameters:
html- The HTML contents to output.
-