Class HtmlValidator


  • public class HtmlValidator
    extends Object
    • Constructor Detail

      • HtmlValidator

        public HtmlValidator()
    • Method Detail

      • ValidateHtmlNameAndIdToken

        public static boolean ValidateHtmlNameAndIdToken​(String nameOrId)
        Validate whether the specified HTML name or id is valid according to the following rule.

        Name or ID token begins with a letter ([A-Za-z]), and maybe followed by any number of letters, digits ([0-9]), hyphens ("-"), underscores ("_"), colons (":"), and periods (".").

        Parameters:
        nameOrId - Name of Id to validate according to HTML's Name and Id naming rule.
        Returns:
        Return true if the specified name or Id is valid, otherwise return false.
      • ValidateHtmlClassAttribName

        public static boolean ValidateHtmlClassAttribName​(String classAttribName)
        Validate whether the specified HTML class attribute name is valid according to the following rule.

        Name or ID token begins with a letter ([A-Za-z]), and maybe followed by any number of letters, digits ([0-9]), hyphens ("-"), and underscores ("_").

        Parameters:
        classAttribName - Class attribute name to validate according to HTML's class attribute name naming rule.
        Returns:
        Return true if the specified class attribute name is valid, otherwise return false.