Class DefaultParserFeedback

  • All Implemented Interfaces:
    java.io.Serializable, ParserFeedback

    public class DefaultParserFeedback
    extends java.lang.Object
    implements ParserFeedback, java.io.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:
    ParserFeedback, FeedbackManager, Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int DEBUG
      Constructor argument for a debugging feedback.
      protected int mMode
      Verbosity level.
      static int NORMAL
      Constructor argument for a normal feedback.
      static int QUIET
      Constructor argument for a quiet feedback.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void error​(java.lang.String message, ParserException exception)
      Print an error message.
      void info​(java.lang.String message)
      Print an info message.
      void warning​(java.lang.String message)
      Print an warning message.
      • Methods inherited from class java.lang.Object

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

      • QUIET

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

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

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

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

      • 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:
        java.lang.IllegalArgumentException - if mode is not QUIET, NORMAL or DEBUG.
      • DefaultParserFeedback

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

      • info

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

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

        public void error​(java.lang.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.