org.htmlparser.util

Class DefaultParserFeedback

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: ParserFeedback FeedbackManager

Field Summary
static intDEBUG
Constructor argument for a debugging feedback.
protected intmMode
Verbosity level.
static intNORMAL
Constructor argument for a normal feedback.
static intQUIET
Constructor argument for a quiet feedback.
Constructor Summary
DefaultParserFeedback(int mode)
Construct a feedback object of the given type.
DefaultParserFeedback()
Construct a NORMAL feedback object.
Method Summary
voiderror(String message, ParserException exception)
Print an error message.
voidinfo(String message)
Print an info message.
voidwarning(String message)
Print an warning message.

Field Detail

DEBUG

public static final int DEBUG
Constructor argument for a debugging feedback.

mMode

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

NORMAL

public static final int NORMAL
Constructor argument for a normal feedback.

QUIET

public static final int QUIET
Constructor argument for a quiet feedback.

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

DefaultParserFeedback

public DefaultParserFeedback()
Construct a NORMAL feedback object.

Method Detail

error

public void error(String message, ParserException exception)
Print an error message.

Parameters: message The message to print. exception The exception for stack tracing.

info

public void info(String message)
Print an info message.

Parameters: message The message to print.

warning

public void warning(String message)
Print an warning message.

Parameters: message The message to print.

HTML Parser is an open source library released under LGPL. SourceForge.net