Package org.spiderwiz.zutils
Class ZHtml
java.lang.Object
org.spiderwiz.zutils.ZHtml
public final class ZHtml extends Object
A utility class for generating simple HTML documents.
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classZHtml.AnchorRepresents an anchor node (<a>).classZHtml.CellRepresents a table cell node (<td>).classZHtml.DivRepresents a div element (<div>).classZHtml.DocumentRepresents the root node of an HTML document.classZHtml.HeadingRepresents a heading tag with a given level (<hlevel>).classZHtml.NodeRepresents an HTML node.classZHtml.ParagraphRepresents a text paragraph (<p>).classZHtml.RowRepresents a table row node (<tr>).classZHtml.StylesPredefined CSS styles.classZHtml.TableRepresents a table node (<table>).classZHtml.TextNodeRepresents a generic node that can be incrementally loaded with anything from plain text to nodes of other types. -
Method Summary
Modifier and Type Method Description static ZHtml.DocumentcreateDocument()Instantiates a new HTML Document node with no title.static ZHtml.DocumentcreateDocument(String title)Instantiates a new HTML Document node with the given title.static Stringescape(String s)Encode the give text as valid HTML visible textstatic StringtoPlainText(String html)Converts HTML code to plain text while preserving line breaks.
-
Method Details
-
createDocument
Instantiates a new HTML Document node with no title.- Returns:
- the document node.
-
createDocument
Instantiates a new HTML Document node with the given title.- Parameters:
title- the title of the document.- Returns:
- the document node.
-
escape
Encode the give text as valid HTML visible text- Parameters:
s- plain text- Returns:
- HTML text
-
toPlainText
Converts HTML code to plain text while preserving line breaks.- Parameters:
html- HTML code to convert- Returns:
- the converted text.
-