1 31 32 package org.opencms.xml; 33 34 import org.opencms.main.CmsLog; 35 36 import org.apache.commons.logging.Log; 37 38 import org.xml.sax.ErrorHandler ; 39 import org.xml.sax.SAXException ; 40 import org.xml.sax.SAXParseException ; 41 42 53 public class CmsXmlErrorHandler implements ErrorHandler { 54 55 56 private static final Log LOG = CmsLog.getLog(CmsXmlErrorHandler.class); 57 58 61 public void error(SAXParseException exception) throws SAXException { 62 63 LOG.error(Messages.get().getBundle().key(Messages.LOG_PARSING_XML_RESOURCE_ERROR_0), exception); 64 throw exception; 65 } 66 67 70 public void fatalError(SAXParseException exception) throws SAXException { 71 72 LOG.error(Messages.get().getBundle().key(Messages.LOG_PARSING_XML_RESOURCE_FATAL_ERROR_0), exception); 73 throw exception; 74 } 75 76 79 public void warning(SAXParseException exception) { 80 81 if (LOG.isWarnEnabled()) { 82 LOG.error(Messages.get().getBundle().key(Messages.LOG_PARSING_XML_RESOURCE_WARNING_0), exception); 83 } 84 } 85 } 86 | Popular Tags |