KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > microstar > xml > XmlException


1 // XmlException.java: Simple base class for AElfred processors.
2
// NO WARRANTY! See README, and copyright below.
3
// $Id: XmlException.java 3792 2001-09-02 05:37:43Z spestov $
4

5 package com.microstar.xml;
6
7
8 /**
9   * Convenience exception class for reporting XML parsing errors.
10   * <p>This is an exception class that you can use to encapsulate all
11   * of the information from &AElig;lfred's <code>error</code> callback.
12   * This is not necessary for routine use of &AElig;lfred, but it
13   * is used by the optional <code>HandlerBase</code> class.
14   * <p>Note that the core &AElig;lfred classes do <em>not</em>
15   * use this exception.
16   * @author Copyright (c) 1998 by Microstar Software Ltd.
17   * @author written by David Megginson &lt;dmeggins@microstar.com&gt;
18   * @version 1.1
19   * @see XmlHandler#error
20   * @see HandlerBase
21   */

22 public class XmlException extends Exception JavaDoc
23 {
24   private String JavaDoc message;
25   private String JavaDoc systemId;
26   private int line;
27   private int column;
28
29
30   /**
31     * Construct a new XML parsing exception.
32     * @param message The error message from the parser.
33     * @param systemId The URI of the entity containing the error.
34     * @param line The line number where the error appeared.
35     * @param column The column number where the error appeared.
36     */

37   public XmlException (String JavaDoc message, String JavaDoc systemId, int line, int column)
38   {
39     this.message = message;
40     this.systemId = systemId;
41     this.line = line;
42     this.column = column;
43   }
44
45
46   /**
47     * Get the error message from the parser.
48     * @return A string describing the error.
49     */

50   public String JavaDoc getMessage ()
51   {
52     return message;
53   }
54
55
56   /**
57     * Get the URI of the entity containing the error.
58     * @return The URI as a string.
59     */

60   public String JavaDoc getSystemId ()
61   {
62     return systemId;
63   }
64
65
66   /**
67     * Get the line number containing the error.
68     * @return The line number as an integer.
69     */

70   public int getLine ()
71   {
72     return line;
73   }
74
75   /**
76     * Get the column number containing the error.
77     * @return The column number as an integer.
78     */

79   public int getColumn ()
80   {
81     return column;
82   }
83
84 }
85
Popular Tags