01: /*
02: * $RCSfile: XmlParseException.java,v $
03: * @modification $Date: 2001/09/28 19:41:42 $
04: * @version $Id: XmlParseException.java,v 1.1 2001/09/28 19:41:42 hfalk Exp $
05: *
06: */
07:
08: package com.memoire.vainstall.builder.util;
09:
10: import org.xml.sax.*;
11:
12: /**
13: * This exception class wraps a SAXParseException and is
14: * able to return its message as formatted HTML.
15: *
16: * @see org.xml.sax.SAXParseException
17: *
18: * @author Henrik Falk
19: * @version $Id: XmlParseException.java,v 1.1 2001/09/28 19:41:42 hfalk Exp $
20: */
21: public class XmlParseException extends SAXParseException {
22:
23: private SAXParseException saxParseException;
24:
25: public XmlParseException(SAXParseException exc) {
26: super (exc.getMessage(), (Locator) null);
27: saxParseException = exc;
28: }
29:
30: public XmlParseException(String message, Locator locator) {
31: super (message, locator);
32: saxParseException = this ;
33: }
34:
35: public String getMessageAsHtml() {
36:
37: String out = "<html><b><font color=black size=2><left>";
38: out += "Parser Error :<br>";
39: out += "<font color=red size=2>"
40: + saxParseException.getMessage() + "</font><br>";
41: out += "Line = <font color=red size=2>"
42: + saxParseException.getLineNumber() + "</font><br>";
43: out += "Column = <font color=red size=2>"
44: + saxParseException.getColumnNumber() + "</font>";
45: out += "</left></font></b></html>";
46:
47: return out;
48: }
49:
50: }
|