1 57 package com.sun.org.apache.xerces.internal.jaxp.validation; 58 59 import com.sun.org.apache.xerces.internal.xni.parser.XMLErrorHandler; 60 import com.sun.org.apache.xerces.internal.xni.parser.XMLParseException; 61 import org.xml.sax.ErrorHandler ; 62 import org.xml.sax.SAXException ; 63 64 71 public abstract class ErrorHandlerAdaptor implements XMLErrorHandler 72 { 73 74 private boolean hadError = false; 75 76 80 public boolean hadError() { return hadError; } 81 82 public void reset() { hadError = false; } 83 84 90 protected abstract ErrorHandler getErrorHandler(); 91 92 public void fatalError( String domain, String key, XMLParseException e ) { 93 try { 94 hadError = true; 95 getErrorHandler().fatalError( Util.toSAXParseException(e) ); 96 } catch( SAXException se ) { 97 throw new WrappedSAXException(se); 98 } 99 } 100 101 public void error( String domain, String key, XMLParseException e ) { 102 try { 103 hadError = true; 104 getErrorHandler().error( Util.toSAXParseException(e) ); 105 } catch( SAXException se ) { 106 throw new WrappedSAXException(se); 107 } 108 } 109 110 public void warning( String domain, String key, XMLParseException e ) { 111 try { 112 getErrorHandler().warning( Util.toSAXParseException(e) ); 113 } catch( SAXException se ) { 114 throw new WrappedSAXException(se); 115 } 116 } 117 118 } 119 | Popular Tags |