KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > proactive > core > xml > io > SAXParserErrorHandler


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