Interface HTMLBuilder

  • All Known Implementing Classes:
    HTMLBuilderImpl

    public interface HTMLBuilder
    Simple builder interface for managing the creation of compliant HTML, and ensuring that escaping is done correctly.
    • Method Detail

      • startTag

        void startTag​(java.lang.String tag)
        Pushes a new open tag onto the context
        Parameters:
        tag - xhtml tag to push.
      • addAttribute

        void addAttribute​(java.lang.String attr,
                          java.lang.String value)
      • addText

        void addText​(java.lang.String text)
      • addUnescapedText

        void addUnescapedText​(java.lang.String text)
      • endTag

        void endTag()
      • getCurrentOpenTag

        java.lang.String getCurrentOpenTag()
      • setCurrentOpenTag

        void setCurrentOpenTag​(java.lang.String tag)
      • getCurrentOpenTagAttribute

        java.lang.String getCurrentOpenTagAttribute​(java.lang.String name)
      • withParentTag

        HTMLBuilder withParentTag()
        Returns:
        an HTML builder for the parent tag, allowing you to modify already created HTML elements.
      • withRootTag

        HTMLBuilder withRootTag()
        Returns:
        the HTML builder for the root (i.e. <html>) tag at the start of the document.