Class HtmlTag

java.lang.Object
org.apache.maven.doxia.markup.HtmlTag

public final class HtmlTag extends Object
An HTML tag name together with the one property Doxia reads from it: whether a start tag may be preceded by a line break. It replaces javax.swing.text.html.HTML.Tag in the sink API, which carries an HTML 4 table Doxia has outgrown.

The block values of the known tags are those the HtmlMarkup constants report today, copied unchanged so that no generated site's whitespace moves. Several of them are wrong for HTML5 — section, article and figure are not treated as block, while menu and title are — and correcting them is a separate change with its own before-and-after site comparison.

Since:
2.2.0
  • Constructor Details

    • HtmlTag

      public HtmlTag(String name, boolean block)
      Constructs a tag.
      Parameters:
      name - the tag name, not null.
      block - whether a start tag may be preceded by a line break.
  • Method Details

    • valueOf

      public static HtmlTag valueOf(String name)
      Returns the tag of the given name known to Doxia.
      Parameters:
      name - a tag name, not null.
      Returns:
      the tag, or null if Doxia declares no tag of that name.
    • getName

      public String getName()
      Returns the tag name.
      Returns:
      the tag name, never null.
    • isBlock

      public boolean isBlock()
      Returns whether a start tag may be preceded by a line break.
      Returns:
      true if the tag is a block-level tag.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object other)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object