fi.iki.hsivonen.verifierservlet
Class XhtmlEmittingErrorHandler

java.lang.Object
  extended by fi.iki.hsivonen.verifierservlet.XhtmlEmittingErrorHandler
All Implemented Interfaces:
ErrorHandler

public class XhtmlEmittingErrorHandler
extends Object
implements ErrorHandler

Version:
$Id: XhtmlEmittingErrorHandler.java,v 1.16 2006/12/01 12:52:52 hsivonen Exp $
Author:
hsivonen

Field Summary
private static char[] COLUMN
           
private  XhtmlSaxEmitter emitter
           
private static char[] ERROR
           
private  int errors
           
private static char[] FATAL_ERROR
           
private  int fatalErrors
           
private static char[] IN_RESOURCE
           
private static char[] INFO
           
private static char[] INTERNAL_ERROR
           
private static char[] IO_ERROR
           
private static char[] LINE
           
private  boolean listOpen
           
private static char[] SCHEMA_ERROR
           
private static char[] SPACE
           
private static char[] WARNING
           
private  int warnings
           
 
Constructor Summary
XhtmlEmittingErrorHandler(ContentHandler contentHandler)
           
 
Method Summary
private  void emitError(char[] level, Exception e)
           
private  void emitError(char[] level, SAXParseException e)
           
private  void emitErrorLevel(char[] level)
           
private  void emitErrorLocation(SAXParseException e)
           
private  void emitErrorMsg(char[] level, Exception e)
           
private  void emitMessage(String message)
           
 void end()
           
 void error(SAXParseException e)
           
 void fatalError(SAXParseException e)
           
 int getErrors()
           
 int getFatalErrors()
           
 int getWarnings()
           
 void info(String str)
           
 void internalError(Throwable e, String message)
           
 void ioError(IOException e)
           
 boolean isErrors()
           
private  String levelToClass(char[] level)
           
private  void maybeOpenList()
           
 void schemaError(Exception e)
           
private static String scrub(String s)
           
 void start()
           
 void warning(SAXParseException e)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INFO

private static final char[] INFO

WARNING

private static final char[] WARNING

ERROR

private static final char[] ERROR

FATAL_ERROR

private static final char[] FATAL_ERROR

IO_ERROR

private static final char[] IO_ERROR

INTERNAL_ERROR

private static final char[] INTERNAL_ERROR

SCHEMA_ERROR

private static final char[] SCHEMA_ERROR

SPACE

private static final char[] SPACE

LINE

private static final char[] LINE

COLUMN

private static final char[] COLUMN

IN_RESOURCE

private static final char[] IN_RESOURCE

emitter

private XhtmlSaxEmitter emitter

listOpen

private boolean listOpen

warnings

private int warnings

errors

private int errors

fatalErrors

private int fatalErrors
Constructor Detail

XhtmlEmittingErrorHandler

public XhtmlEmittingErrorHandler(ContentHandler contentHandler)
Parameters:
contentHandler -
Method Detail

scrub

private static String scrub(String s)
                     throws SAXException
Throws:
SAXException

getErrors

public int getErrors()
Returns:
Returns the errors.

getFatalErrors

public int getFatalErrors()
Returns:
Returns the fatalErrors.

getWarnings

public int getWarnings()
Returns:
Returns the warnings.

maybeOpenList

private void maybeOpenList()
                    throws SAXException
Throws:
SAXException

emitMessage

private void emitMessage(String message)
                  throws SAXException
Throws:
SAXException

emitErrorLevel

private void emitErrorLevel(char[] level)
                     throws SAXException
Throws:
SAXException

emitError

private void emitError(char[] level,
                       SAXParseException e)
                throws SAXException
Throws:
SAXException

emitError

private void emitError(char[] level,
                       Exception e)
                throws SAXException
Throws:
SAXException

emitErrorLocation

private void emitErrorLocation(SAXParseException e)
                        throws SAXException
Parameters:
e -
Throws:
SAXException

emitErrorMsg

private void emitErrorMsg(char[] level,
                          Exception e)
                   throws SAXException
Parameters:
level -
e -
Throws:
SAXException

warning

public void warning(SAXParseException e)
             throws SAXException
Specified by:
warning in interface ErrorHandler
Throws:
SAXException
See Also:
ErrorHandler.warning(org.xml.sax.SAXParseException)

error

public void error(SAXParseException e)
           throws SAXException
Specified by:
error in interface ErrorHandler
Throws:
SAXException
See Also:
ErrorHandler.error(org.xml.sax.SAXParseException)

fatalError

public void fatalError(SAXParseException e)
                throws SAXException
Specified by:
fatalError in interface ErrorHandler
Throws:
SAXException
See Also:
ErrorHandler.fatalError(org.xml.sax.SAXParseException)

end

public void end()
         throws SAXException
Throws:
SAXException

start

public void start()
           throws SAXException
Throws:
SAXException

info

public void info(String str)
          throws SAXException
Parameters:
e -
Throws:
SAXException

ioError

public void ioError(IOException e)
             throws SAXException
Parameters:
e -
Throws:
SAXException

internalError

public void internalError(Throwable e,
                          String message)
                   throws SAXException
Parameters:
e -
Throws:
SAXException

levelToClass

private String levelToClass(char[] level)

schemaError

public void schemaError(Exception e)
                 throws SAXException
Parameters:
e -
Throws:
SAXException

isErrors

public boolean isErrors()