Class HtmlEndTagValidator


  • public class HtmlEndTagValidator
    extends java.lang.Object
    Checks that a page has at least one closing HTML tag. Does not check, that this tag is the only one. It uses a regular expression.

    HTML comments are permitted after the closing HTML tag. Anything else will be logged as warning.

    It also assumes a lower-case closing HTML tag according to the HTML/XHTML standard.

    • Method Detail

      • validate

        public void validate​(HtmlPage page)
        Validates the specified HTML page.
        Parameters:
        page - the page to check
        Throws:
        java.lang.AssertionError - if the page fails validation
      • validate

        public void validate​(LightWeightPage page)
        Validates the specified lightweight HTML page.
        Parameters:
        page - the page to check
        Throws:
        java.lang.AssertionError - if the page fails validation
      • validate

        public void validate​(java.lang.String content)
        The validation as plain string method to be tested and used independently from the page.
        Parameters:
        content - a snippet of HTML code to be checked
      • getInstance

        public static HtmlEndTagValidator getInstance()
        Returns the singleton instance.
        Returns:
        the singleton instance