+++ /dev/null
-// SAX exception class.\r
-// No warranty; no copyright -- use this as you will.\r
-// $Id: SAXException.java,v 1.1 2000/10/02 02:43:17 sboag Exp $\r
-\r
-package org.xml.sax;\r
-\r
-/**\r
- * Encapsulate a general SAX error or warning.\r
- *\r
- * <blockquote>\r
- * <em>This module, both source code and documentation, is in the\r
- * Public Domain, and comes with <strong>NO WARRANTY</strong>.</em>\r
- * </blockquote>\r
- *\r
- * <p>This class can contain basic error or warning information from\r
- * either the XML parser or the application: a parser writer or\r
- * application writer can subclass it to provide additional\r
- * functionality. SAX handlers may throw this exception or\r
- * any exception subclassed from it.</p>\r
- *\r
- * <p>If the application needs to pass through other types of\r
- * exceptions, it must wrap those exceptions in a SAXException\r
- * or an exception derived from a SAXException.</p>\r
- *\r
- * <p>If the parser or application needs to include information about a\r
- * specific location in an XML document, it should use the\r
- * {@link org.xml.sax.SAXParseException SAXParseException} subclass.</p>\r
- *\r
- * @since SAX 1.0\r
- * @author David Megginson, \r
- * <a href="mailto:sax@megginson.com">sax@megginson.com</a>\r
- * @version 2.0\r
- * @see org.xml.sax.SAXParseException\r
- */\r
-public class SAXException extends Exception {\r
- \r
- \r
- /**\r
- * Create a new SAXException.\r
- *\r
- * @param message The error or warning message.\r
- * @see org.xml.sax.Parser#setLocale\r
- */\r
- public SAXException (String message) {\r
- super(message);\r
- this.exception = null;\r
- }\r
- \r
- \r
- /**\r
- * Create a new SAXException wrapping an existing exception.\r
- *\r
- * <p>The existing exception will be embedded in the new\r
- * one, and its message will become the default message for\r
- * the SAXException.</p>\r
- *\r
- * @param e The exception to be wrapped in a SAXException.\r
- */\r
- public SAXException (Exception e)\r
- {\r
- super();\r
- this.exception = e;\r
- }\r
- \r
- \r
- /**\r
- * Create a new SAXException from an existing exception.\r
- *\r
- * <p>The existing exception will be embedded in the new\r
- * one, but the new exception will have its own message.</p>\r
- *\r
- * @param message The detail message.\r
- * @param e The exception to be wrapped in a SAXException.\r
- * @see org.xml.sax.Parser#setLocale\r
- */\r
- public SAXException (String message, Exception e)\r
- {\r
- super(message);\r
- this.exception = e;\r
- }\r
- \r
- \r
- /**\r
- * Return a detail message for this exception.\r
- *\r
- * <p>If there is an embedded exception, and if the SAXException\r
- * has no detail message of its own, this method will return\r
- * the detail message from the embedded exception.</p>\r
- *\r
- * @return The error or warning message.\r
- * @see org.xml.sax.Parser#setLocale\r
- */\r
- public String getMessage ()\r
- {\r
- String message = super.getMessage();\r
- \r
- if (message == null && exception != null) {\r
- return exception.getMessage();\r
- } else {\r
- return message;\r
- }\r
- }\r
- \r
- \r
- /**\r
- * Return the embedded exception, if any.\r
- *\r
- * @return The embedded exception, or null if there is none.\r
- */\r
- public Exception getException ()\r
- {\r
- return exception;\r
- }\r
-\r
-\r
- /**\r
- * Override toString to pick up any embedded exception.\r
- *\r
- * @return A string representation of this exception.\r
- */\r
- public String toString ()\r
- {\r
- if (exception != null) {\r
- return exception.toString();\r
- } else {\r
- return super.toString();\r
- }\r
- }\r
- \r
- \r
- \f\r
- //////////////////////////////////////////////////////////////////////\r
- // Internal state.\r
- //////////////////////////////////////////////////////////////////////\r
-\r
-\r
- /**\r
- * @serial The embedded exception if tunnelling, or null.\r
- */ \r
- private Exception exception;\r
- \r
-}\r
-\r
-// end of SAXException.java\r