01: // XmlException.java: Simple base class for AElfred processors.
02: // NO WARRANTY! See README, and copyright below.
03: // $Id: XmlException.java 3792 2001-09-02 05:37:43Z spestov $
04:
05: package com.microstar.xml;
06:
07: /**
08: * Convenience exception class for reporting XML parsing errors.
09: * <p>This is an exception class that you can use to encapsulate all
10: * of the information from Ælfred's <code>error</code> callback.
11: * This is not necessary for routine use of Ælfred, but it
12: * is used by the optional <code>HandlerBase</code> class.
13: * <p>Note that the core Ælfred classes do <em>not</em>
14: * use this exception.
15: * @author Copyright (c) 1998 by Microstar Software Ltd.
16: * @author written by David Megginson <dmeggins@microstar.com>
17: * @version 1.1
18: * @see XmlHandler#error
19: * @see HandlerBase
20: */
21: public class XmlException extends Exception {
22: private String message;
23: private String systemId;
24: private int line;
25: private int column;
26:
27: /**
28: * Construct a new XML parsing exception.
29: * @param message The error message from the parser.
30: * @param systemId The URI of the entity containing the error.
31: * @param line The line number where the error appeared.
32: * @param column The column number where the error appeared.
33: */
34: public XmlException(String message, String systemId, int line,
35: int column) {
36: this .message = message;
37: this .systemId = systemId;
38: this .line = line;
39: this .column = column;
40: }
41:
42: /**
43: * Get the error message from the parser.
44: * @return A string describing the error.
45: */
46: public String getMessage() {
47: return message;
48: }
49:
50: /**
51: * Get the URI of the entity containing the error.
52: * @return The URI as a string.
53: */
54: public String getSystemId() {
55: return systemId;
56: }
57:
58: /**
59: * Get the line number containing the error.
60: * @return The line number as an integer.
61: */
62: public int getLine() {
63: return line;
64: }
65:
66: /**
67: * Get the column number containing the error.
68: * @return The column number as an integer.
69: */
70: public int getColumn() {
71: return column;
72: }
73:
74: }
|