01: /*
02: This code based upon NanoXML 2.2 sources
03: */
04:
05: package org.zaval.xml;
06:
07: public class XmlParseException extends RuntimeException {
08: public static final int NO_LINE = -1;
09: private int lineNr;
10:
11: public XmlParseException(String name, String message) {
12: super ("XML Parse Exception during parsing of "
13: + ((name == null) ? "the XML definition"
14: : ("a " + name + " element")) + ": " + message);
15: this .lineNr = NO_LINE;
16: }
17:
18: public XmlParseException(String name, int lineNr, String message) {
19: super ("XML Parse Exception during parsing of "
20: + ((name == null) ? "the XML definition"
21: : ("a " + name + " element")) + " at line "
22: + lineNr + ": " + message);
23: this .lineNr = lineNr;
24: }
25:
26: public int getLineNr() {
27: return this.lineNr;
28: }
29: }
|