java.lang.Object
com.atlassian.plugin.webresource.assembler.html.HtmlTagWriter
Direct Known Subclasses:
InlineHtmlTagWriter, PrefetchHtmlTagWriter

public abstract class HtmlTagWriter extends Object
Represents a Writer wrapper responsible for writing WebResourceInformation.getResourceUrls() as HTML tags, according to their extension.
Since:
5.0.0
  • 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 each WebResourceInformation.getResourceUrls() according to its URL extension type and write it into the writer.
      Parameters:
      information - The information used to generate the import tags.
      predicate - The predicate used to filter the resources based on the WebResource information.
      legacyPredicate - The predicate used to filter the resources based on the ResourceUrl information.
    • writeHtmlTag

      public void writeHtmlTag(@Nonnull Collection<ResourceUrls> resources)
      Generates HTML tags for each ResourceUrls according to its URL extension type and write it into the writer.
      Parameters:
      resources - The resources containing the URL information to be used to generate HTML import tag.
    • writeHtmlTag

      protected void writeHtmlTag(@Nonnull String... html)
      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.