Package org.htmlparser.util
Class DefaultParserFeedback
- java.lang.Object
-
- org.htmlparser.util.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
-
-
Constructor Summary
Constructors Constructor Description DefaultParserFeedback()
Construct a NORMAL feedback object.DefaultParserFeedback(int mode)
Construct a feedback object of the given type.
-
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.
-
-
-
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 interfaceParserFeedback
- Parameters:
message
- The message to print.
-
warning
public void warning(java.lang.String message)
Print an warning message.- Specified by:
warning
in interfaceParserFeedback
- Parameters:
message
- The message to print.
-
error
public void error(java.lang.String message, ParserException exception)
Print an error message.- Specified by:
error
in interfaceParserFeedback
- Parameters:
message
- The message to print.exception
- The exception for stack tracing.
-
-