Class ZHtml

java.lang.Object
org.spiderwiz.zutils.ZHtml

public final class ZHtml
extends Object
A utility class for generating simple HTML documents.
  • Method Details

    • createDocument

      public static ZHtml.Document createDocument()
      Instantiates a new HTML Document node with no title.
      Returns:
      the document node.
    • createDocument

      public static ZHtml.Document createDocument​(String title)
      Instantiates a new HTML Document node with the given title.
      Parameters:
      title - the title of the document.
      Returns:
      the document node.
    • escape

      public static String escape​(String s)
      Encode the give text as valid HTML visible text
      Parameters:
      s - plain text
      Returns:
      HTML text
    • toPlainText

      public static String toPlainText​(String html)
      Converts HTML code to plain text while preserving line breaks.
      Parameters:
      html - HTML code to convert
      Returns:
      the converted text.