org.apache.servicemix.validation.handler
Class CountingErrorHandler

java.lang.Object
  extended by org.apache.servicemix.validation.handler.CountingErrorHandler
All Implemented Interfaces:
MessageAwareErrorHandler, org.xml.sax.ErrorHandler

public class CountingErrorHandler
extends java.lang.Object
implements MessageAwareErrorHandler

A simple implementation of ErrorHandler which just counts the number of warnings, errors and fatal errors.

Version:
$Revision: 430194 $

Constructor Summary
CountingErrorHandler()
           
 
Method Summary
 boolean capturesMessages()
          Does this ErrorHandler implementation capture error messages?
 void error(org.xml.sax.SAXParseException e)
           
 void fatalError(org.xml.sax.SAXParseException e)
           
 int getErrorCount()
          Return the number of errors.
 int getFatalErrorCount()
          Return the number of fatal errors.
 java.lang.Object getMessagesAs(java.lang.Class format)
          Get the messages from this ErrorHandler in a particular format.
 int getWarningCount()
          Return the number of warnings.
 boolean hasErrors()
          Does the error handler contain any error messages?
 boolean supportsMessageFormat(java.lang.Class format)
          Does the message support a given format?
 void warning(org.xml.sax.SAXParseException e)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CountingErrorHandler

public CountingErrorHandler()
Method Detail

hasErrors

public boolean hasErrors()
Description copied from interface: MessageAwareErrorHandler
Does the error handler contain any error messages?

Specified by:
hasErrors in interface MessageAwareErrorHandler
Returns:

getWarningCount

public int getWarningCount()
Description copied from interface: MessageAwareErrorHandler
Return the number of warnings.

Specified by:
getWarningCount in interface MessageAwareErrorHandler
Returns:

getErrorCount

public int getErrorCount()
Description copied from interface: MessageAwareErrorHandler
Return the number of errors.

Specified by:
getErrorCount in interface MessageAwareErrorHandler
Returns:

getFatalErrorCount

public int getFatalErrorCount()
Description copied from interface: MessageAwareErrorHandler
Return the number of fatal errors.

Specified by:
getFatalErrorCount in interface MessageAwareErrorHandler
Returns:

warning

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

error

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

fatalError

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

capturesMessages

public boolean capturesMessages()
Description copied from interface: MessageAwareErrorHandler
Does this ErrorHandler implementation capture error messages?

Specified by:
capturesMessages in interface MessageAwareErrorHandler
Returns:

getMessagesAs

public java.lang.Object getMessagesAs(java.lang.Class format)
                               throws javax.jbi.messaging.MessagingException
Description copied from interface: MessageAwareErrorHandler
Get the messages from this ErrorHandler in a particular format.

Specified by:
getMessagesAs in interface MessageAwareErrorHandler
Returns:
Throws:
javax.jbi.messaging.MessagingException

supportsMessageFormat

public boolean supportsMessageFormat(java.lang.Class format)
Description copied from interface: MessageAwareErrorHandler
Does the message support a given format?

Specified by:
supportsMessageFormat in interface MessageAwareErrorHandler
Returns:


Copyright © 2005-2011 FuseSource. All Rights Reserved.