Class DefaultParserFeedback

java.lang.Object
org.htmlparser.util.DefaultParserFeedback
All Implemented Interfaces:
Serializable, ParserFeedback

public class DefaultParserFeedback extends Object implements ParserFeedback, Serializable
Default implementation of the HTMLParserFeedback interface. This implementation prints output to the console but users can implement their own classes to support alternate behavior.
See Also:
  • Field Details

    • QUIET

      public static final int QUIET
      Constructor argument for a quiet feedback.
      See Also:
    • NORMAL

      public static final int NORMAL
      Constructor argument for a normal feedback.
      See Also:
    • DEBUG

      public static final int DEBUG
      Constructor argument for a debugging feedback.
      See Also:
    • mMode

      protected int mMode
      Verbosity level. Corresponds to constructor arguments:
         DEBUG = 2;
         NORMAL = 1;
         QUIET = 0;
       
  • Constructor Details

    • DefaultParserFeedback

      public DefaultParserFeedback(int mode)
      Construct a feedback object of the given type.
      Parameters:
      mode - The type of feedback:
         DEBUG - verbose debugging with stack traces
         NORMAL - normal messages
         QUIET - no messages
       
      Throws:
      IllegalArgumentException - if mode is not QUIET, NORMAL or DEBUG.
    • DefaultParserFeedback

      public DefaultParserFeedback()
      Construct a NORMAL feedback object.
  • Method Details

    • info

      public void info(String message)
      Print an info message.
      Specified by:
      info in interface ParserFeedback
      Parameters:
      message - The message to print.
    • warning

      public void warning(String message)
      Print an warning message.
      Specified by:
      warning in interface ParserFeedback
      Parameters:
      message - The message to print.
    • error

      public void error(String message, ParserException exception)
      Print an error message.
      Specified by:
      error in interface ParserFeedback
      Parameters:
      message - The message to print.
      exception - The exception for stack tracing.