org.cyberneko.html
Class HTMLConfiguration.ErrorReporter

java.lang.Object
  extended byorg.cyberneko.html.HTMLConfiguration.ErrorReporter
All Implemented Interfaces:
HTMLErrorReporter
Enclosing class:
HTMLConfiguration

protected class HTMLConfiguration.ErrorReporter
extends Object
implements HTMLErrorReporter

Defines an error reporter for reporting HTML errors. There is no such thing as a fatal error in parsing HTML. I/O errors are fatal but should throw an IOException directly instead of reporting an error.

When used in a configuration, the error reporter instance should be set as a property with the following property identifier:

 "http://cyberneko.org/html/internal/error-reporter" in the
 
Components in the configuration can query the error reporter using this property identifier.

Note: All reported errors are within the domain "http://cyberneko.org/html".

Author:
Andy Clark

Field Summary
protected  ResourceBundle fErrorMessages
          Error messages.
protected  Locale fLastLocale
          Last locale.
 
Constructor Summary
protected HTMLConfiguration.ErrorReporter()
           
 
Method Summary
protected  XMLParseException createException(String key, Object[] args)
          Creates parse exception.
 String formatMessage(String key, Object[] args)
          Format message without reporting error.
protected  String formatSimpleMessage(String key, Object[] args)
          Format simple message.
 void reportError(String key, Object[] args)
          Reports an error.
 void reportWarning(String key, Object[] args)
          Reports a warning.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fLastLocale

protected Locale fLastLocale
Last locale.


fErrorMessages

protected ResourceBundle fErrorMessages
Error messages.

Constructor Detail

HTMLConfiguration.ErrorReporter

protected HTMLConfiguration.ErrorReporter()
Method Detail

formatMessage

public String formatMessage(String key,
                            Object[] args)
Format message without reporting error.

Specified by:
formatMessage in interface HTMLErrorReporter

reportWarning

public void reportWarning(String key,
                          Object[] args)
                   throws XMLParseException
Reports a warning.

Specified by:
reportWarning in interface HTMLErrorReporter
Throws:
XMLParseException

reportError

public void reportError(String key,
                        Object[] args)
                 throws XMLParseException
Reports an error.

Specified by:
reportError in interface HTMLErrorReporter
Throws:
XMLParseException

createException

protected XMLParseException createException(String key,
                                            Object[] args)
Creates parse exception.


formatSimpleMessage

protected String formatSimpleMessage(String key,
                                     Object[] args)
Format simple message.



(C) Copyright 2002-2004, Andy Clark. All rights reserved.