org.htmlparser.util

Class DefaultParserFeedback

Implemented Interfaces:
ParserFeedback, Serializable

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 int
DEBUG
Constructor argument for a debugging feedback.
static int
NORMAL
Constructor argument for a normal feedback.
static int
QUIET
Constructor argument for a quiet feedback.
protected int
mMode
Verbosity level.

Constructor Summary

DefaultParserFeedback()
Construct a NORMAL feedback object.
DefaultParserFeedback(int mode)
Construct a feedback object of the given type.

Method Summary

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

Field Details

DEBUG

public static final int DEBUG
Constructor argument for a debugging feedback.
Field Value:
2

NORMAL

public static final int NORMAL
Constructor argument for a normal feedback.
Field Value:
1

QUIET

public static final int QUIET
Constructor argument for a quiet feedback.
Field Value:
0

mMode

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

Constructor Details

DefaultParserFeedback

public DefaultParserFeedback()
Construct a NORMAL feedback object.

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

Method Details

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.

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.

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