Class ZHtml.Node

java.lang.Object
org.spiderwiz.zutils.ZHtml.Node
Direct Known Subclasses:
ZHtml.Cell, ZHtml.Document, ZHtml.Heading, ZHtml.Row, ZHtml.Table, ZHtml.TextNode
Enclosing class:
ZHtml

public abstract class ZHtml.Node
extends Object
Represents an HTML node.
  • Method Details

    • createTextNode

      public final ZHtml.TextNode createTextNode​(String text)
      Instantiates a node with the given text.

      The method just instantiates the node without connecting it to any other node. This can be done with methods such as TextNode.addNode() etc.

      Parameters:
      text - the text contained in the returned node.
      Returns:
      the instantiated node.
    • createAnchor

      public final ZHtml.Anchor createAnchor​(String text, String ref, String... args)
      Instantiates an anchor node (a tag) with the given text, url (ref attribute) and optional arguments to inject in the url.
      Parameters:
      text - the text displayed in the node.
      ref - the url (ref attribute) that the node links to.
      args - a variable list of parameter to inject in the url in the format ...?arg1&arg2&arg3 etc.
      Returns:
      the instantiated Anchor object.
    • addStyle

      public final String addStyle​(String style)
      Adds a style to the node's current list of styles.
      Parameters:
      style - the style to add
      Returns:
      the full list of styles, concatenated by a semicolon (;).