X-Git-Url: http://sraa.de/git/?a=blobdiff_plain;f=dol%2Fsrc%2Fdol%2Fparser%2Fxml%2FXmlErrorHandler.java;fp=dol%2Fsrc%2Fdol%2Fparser%2Fxml%2FXmlErrorHandler.java;h=d1105bd3558d0786eb1494d9c4af106bb47698f6;hb=8c411cf24ed0eb889191aaeafd8fa1e69081df42;hp=0000000000000000000000000000000000000000;hpb=dea7a4fb1ed110d3ce6e6d9255103d724bd66c0e;p=jump.git diff --git a/dol/src/dol/parser/xml/XmlErrorHandler.java b/dol/src/dol/parser/xml/XmlErrorHandler.java new file mode 100644 index 0000000..d1105bd --- /dev/null +++ b/dol/src/dol/parser/xml/XmlErrorHandler.java @@ -0,0 +1,45 @@ +/* $Id: XmlErrorHandler.java 1 2010-02-24 13:03:05Z haidw $ */ +package dol.parser.xml; + +import org.xml.sax.SAXParseException; +import org.xml.sax.helpers.DefaultHandler; + +/** + * This class ... + */ + +public class XmlErrorHandler extends DefaultHandler { + + /** + * Empty constructor + */ + public XmlErrorHandler() { + super(); + } + + /** + * Treat validation errors as fatal + * + * @param e Description of the Parameter + * @exception SAXParseException MyException If such and such occurs + */ + public void error(SAXParseException e) + throws SAXParseException { + System.out.println("Error found: " + e.getMessage()); + throw e; + } + + /** + * Dump warnings too + * + * @param err Description of the Parameter + * @exception SAXParseException MyException If such and such occurs + */ + public void warning(SAXParseException err) + throws SAXParseException { + System.out.println("** Warning" + + ", line " + err.getLineNumber() + + ", uri " + err.getSystemId()); + System.out.println(" " + err.getMessage()); + } +}