Class SimpleHTMLParserListener

  • All Implemented Interfaces:
    HTMLParserListener

    class SimpleHTMLParserListener
    extends java.lang.Object
    implements HTMLParserListener
    Simple implementation of HTMLParserListener logging the received warnings and errors in the "org.htmlunit.html.HTMLParserListener" log.
    Errors are logged at the error level and warnings at the warning level.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static org.apache.commons.logging.Log LOG  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void error​(java.lang.String message, java.net.URL url, java.lang.String html, int line, int column, java.lang.String key)
      Called when the HTML parser reports an error.
      private static java.lang.String format​(java.lang.String message, java.net.URL url, java.lang.String html, int line, int column)  
      void warning​(java.lang.String message, java.net.URL url, java.lang.String html, int line, int column, java.lang.String key)
      Called when the HTML parser reports a warning.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • LOG

        private static final org.apache.commons.logging.Log LOG
    • Constructor Detail

      • SimpleHTMLParserListener

        SimpleHTMLParserListener()
    • Method Detail

      • error

        public void error​(java.lang.String message,
                          java.net.URL url,
                          java.lang.String html,
                          int line,
                          int column,
                          java.lang.String key)
        Description copied from interface: HTMLParserListener
        Called when the HTML parser reports an error.
        Specified by:
        error in interface HTMLParserListener
        Parameters:
        message - the description of the problem
        url - the URL of the document in which the problem occurs
        html - the content of the snippet in which the problem occurs
        line - the line of the problem
        column - the column of the problem
        key - the key identifying the "type" of problem
      • warning

        public void warning​(java.lang.String message,
                            java.net.URL url,
                            java.lang.String html,
                            int line,
                            int column,
                            java.lang.String key)
        Description copied from interface: HTMLParserListener
        Called when the HTML parser reports a warning.
        Specified by:
        warning in interface HTMLParserListener
        Parameters:
        message - the description of the problem
        url - the URL of the document in which the problem occurs
        html - the content of the snippet in which the problem occurs
        line - the line of the problem
        column - the column of the problem
        key - the key identifying the "type" of problem
      • format

        private static java.lang.String format​(java.lang.String message,
                                               java.net.URL url,
                                               java.lang.String html,
                                               int line,
                                               int column)