com.virtuosotechnologies.lib.xml
Class MessageCollectingErrorHandler

java.lang.Object
  extended bycom.virtuosotechnologies.lib.xml.MessageCollectingErrorHandler
All Implemented Interfaces:
ErrorHandler

public class MessageCollectingErrorHandler
extends Object
implements ErrorHandler

ErrorHandler that collects messages


Constructor Summary
MessageCollectingErrorHandler(int maxerrors, int maxwarnings)
          Constructor
 
Method Summary
 void error(SAXParseException ex)
           
 void fatalError(SAXParseException ex)
           
 boolean hasErrors()
          Returns true if at least one error was reported
 boolean hasMessages()
          Returns true if at least one message (error or warning) was reported
 String toString()
          Get the string
 void warning(SAXParseException ex)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MessageCollectingErrorHandler

public MessageCollectingErrorHandler(int maxerrors,
                                     int maxwarnings)
Constructor

Parameters:
maxerrors - maximum number of errors to collect. If more errors are reported, this terminates parsing.
maxwarnings - maximum number of warnings to collect. If more warnings are reported, they are discarded.
Method Detail

hasErrors

public boolean hasErrors()
Returns true if at least one error was reported


hasMessages

public boolean hasMessages()
Returns true if at least one message (error or warning) was reported


error

public void error(SAXParseException ex)
           throws SAXException
Specified by:
error in interface ErrorHandler
Throws:
SAXException

fatalError

public void fatalError(SAXParseException ex)
                throws SAXException
Specified by:
fatalError in interface ErrorHandler
Throws:
SAXException

warning

public void warning(SAXParseException ex)
             throws SAXException
Specified by:
warning in interface ErrorHandler
Throws:
SAXException

toString

public String toString()
Get the string