Class HtmlTag


  • public final class HtmlTag
    extends java.lang.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 Summary

      Constructors 
      Constructor Description
      HtmlTag​(java.lang.String name, boolean block)
      Constructs a tag.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object other)  
      java.lang.String getName()
      Returns the tag name.
      int hashCode()  
      boolean isBlock()
      Returns whether a start tag may be preceded by a line break.
      java.lang.String toString()  
      static HtmlTag valueOf​(java.lang.String name)
      Returns the tag of the given name known to Doxia.
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • HtmlTag

        public HtmlTag​(java.lang.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 Detail

      • valueOf

        public static HtmlTag valueOf​(java.lang.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 java.lang.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 java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object other)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object