001 package com.thaiopensource.xml.sax;
002
003 import org.xml.sax.ErrorHandler;
004 import org.xml.sax.SAXParseException;
005 import org.xml.sax.SAXException;
006
007 /**
008 * An <code>ErrorHandler</code> implementing a brutal error handling policy.
009 * Fatal errors and errors are handled by throwing the exception.
010 * Warnings are ignored.
011 *
012 * @author <a href="mailto:jjc@jclark.com">James Clark</a>
013 */
014 public class DraconianErrorHandler implements ErrorHandler {
015 public void warning(SAXParseException e) throws SAXException {
016 }
017
018 public void error(SAXParseException e) throws SAXException {
019 throw e;
020 }
021
022 public void fatalError(SAXParseException e) throws SAXException {
023 throw e;
024 }
025 }