dol: initial dol commit
[jump.git] / dol / src / dol / parser / xml / XmlErrorHandler.java
1 /* $Id: XmlErrorHandler.java 1 2010-02-24 13:03:05Z haidw $ */
2 package dol.parser.xml;
3
4 import org.xml.sax.SAXParseException;
5 import org.xml.sax.helpers.DefaultHandler;
6
7 /**
8  *  This class ...
9  */
10
11 public class XmlErrorHandler extends DefaultHandler {
12
13     /**
14      * Empty constructor
15      */
16     public XmlErrorHandler() {
17         super();
18     }
19
20     /**
21      *  Treat validation errors as fatal
22      *
23      * @param  e Description of the Parameter
24      * @exception  SAXParseException MyException If such and such occurs
25      */
26     public void error(SAXParseException e)
27              throws SAXParseException {
28         System.out.println("Error found: " + e.getMessage());
29         throw e;
30     }
31
32     /**
33      *  Dump warnings too
34      *
35      * @param  err Description of the Parameter
36      * @exception  SAXParseException MyException If such and such occurs
37      */
38     public void warning(SAXParseException err)
39              throws SAXParseException {
40         System.out.println("** Warning"
41                 + ", line " + err.getLineNumber()
42                 + ", uri " + err.getSystemId());
43         System.out.println("   " + err.getMessage());
44     }
45 }