1 package org.objectweb.proactive.core.xml.io; 2 3 4 5 import org.apache.log4j.Logger; 6 import org.xml.sax.SAXParseException ; 7 import org.xml.sax.SAXException ; 8 import org.xml.sax.helpers.DefaultHandler ; 9 10 public class SAXParserErrorHandler extends DefaultHandler { 11 12 13 static Logger logger = Logger.getLogger(SAXParserErrorHandler.class.getName()); 14 15 public SAXParserErrorHandler() {} 16 17 public void warning(SAXParseException ex) throws SAXException { 18 logger.warn("WARNING: " + ex.getMessage()); 19 } 20 21 public void error(SAXParseException ex) throws SAXException { 22 logger.error("ERROR: "+ex.getSystemId()+" Line:"+ex.getLineNumber()+" Message:"+ex.getMessage()); 23 } 24 25 public void fatalError(SAXParseException ex) throws SAXException { 26 logger.fatal("FATAL ERROR: " + ex.getMessage()); 27 } 28 } 29 30 | Popular Tags |