PageRenderTime 51ms CodeModel.GetById 21ms RepoModel.GetById 0ms app.codeStats 0ms

/jEdit/tags/jedit-4-2-pre4/com/microstar/xml/XmlException.java

#
Java | 84 lines | 31 code | 13 blank | 40 comment | 0 complexity | 96e0a79307dfae4268542180072c3b01 MD5 | raw file
Possible License(s): BSD-3-Clause, AGPL-1.0, Apache-2.0, LGPL-2.0, LGPL-3.0, GPL-2.0, CC-BY-SA-3.0, LGPL-2.1, GPL-3.0, MPL-2.0-no-copyleft-exception, IPL-1.0
  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. package com.microstar.xml;
  5. /**
  6. * Convenience exception class for reporting XML parsing errors.
  7. * <p>This is an exception class that you can use to encapsulate all
  8. * of the information from &AElig;lfred's <code>error</code> callback.
  9. * This is not necessary for routine use of &AElig;lfred, but it
  10. * is used by the optional <code>HandlerBase</code> class.
  11. * <p>Note that the core &AElig;lfred classes do <em>not</em>
  12. * use this exception.
  13. * @author Copyright (c) 1998 by Microstar Software Ltd.
  14. * @author written by David Megginson &lt;dmeggins@microstar.com&gt;
  15. * @version 1.1
  16. * @see XmlHandler#error
  17. * @see HandlerBase
  18. */
  19. public class XmlException extends Exception
  20. {
  21. private String message;
  22. private String systemId;
  23. private int line;
  24. private int column;
  25. /**
  26. * Construct a new XML parsing exception.
  27. * @param message The error message from the parser.
  28. * @param systemId The URI of the entity containing the error.
  29. * @param line The line number where the error appeared.
  30. * @param column The column number where the error appeared.
  31. */
  32. public XmlException (String message, String systemId, int line, int column)
  33. {
  34. this.message = message;
  35. this.systemId = systemId;
  36. this.line = line;
  37. this.column = column;
  38. }
  39. /**
  40. * Get the error message from the parser.
  41. * @return A string describing the error.
  42. */
  43. public String getMessage ()
  44. {
  45. return message;
  46. }
  47. /**
  48. * Get the URI of the entity containing the error.
  49. * @return The URI as a string.
  50. */
  51. public String getSystemId ()
  52. {
  53. return systemId;
  54. }
  55. /**
  56. * Get the line number containing the error.
  57. * @return The line number as an integer.
  58. */
  59. public int getLine ()
  60. {
  61. return line;
  62. }
  63. /**
  64. * Get the column number containing the error.
  65. * @return The column number as an integer.
  66. */
  67. public int getColumn ()
  68. {
  69. return column;
  70. }
  71. }