# SAXException

public class **SAXException** extends [Exception](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Exception.html)  

|---|---|---|
| Known Direct Subclasses [SAXNotRecognizedException](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/SAXNotRecognizedException.html), [SAXNotSupportedException](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/SAXNotSupportedException.html), [SAXParseException](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/SAXParseException.html) |---|---| | [SAXNotRecognizedException](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/SAXNotRecognizedException.html) | Exception class for an unrecognized identifier. | | [SAXNotSupportedException](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/SAXNotSupportedException.html) | Exception class for an unsupported operation. | | [SAXParseException](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/SAXParseException.html) | Encapsulate an XML parse error or warning. | |||

Encapsulate a general SAX error or warning.

> *This module, both source code and documentation, is in the
> Public Domain, and comes with **NO WARRANTY**.* See <http://www.saxproject.org> for further information.

This class can contain basic error or warning information from
either the XML parser or the application: a parser writer or
application writer can subclass it to provide additional
functionality. SAX handlers may throw this exception or
any exception subclassed from it.

If the application needs to pass through other types of
exceptions, it must wrap those exceptions in a SAXException
or an exception derived from a SAXException.

If the parser or application needs to include information about a
specific location in an XML document, it should use the
`https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/SAXParseException.html` subclass.

<br />

##### See Also

- `https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/SAXParseException.html`

### Public Constructor Summary

|---|---|
|   | [SAXException](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/SAXException.html#SAXException())() Create a new SAXException. |
|   | [SAXException](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/SAXException.html#SAXException(java.lang.String))([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) message) Create a new SAXException. |
|   | [SAXException](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/SAXException.html#SAXException(java.lang.Exception))([Exception](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Exception.html) e) Create a new SAXException wrapping an existing exception. |
|   | [SAXException](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/SAXException.html#SAXException(java.lang.String,%20java.lang.Exception))([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) message, [Exception](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Exception.html) e) Create a new SAXException from an existing exception. |

### Public Method Summary

|---|---|
| [Exception](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Exception.html) | [getException](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/SAXException.html#getException())() Return the embedded exception, if any. |
| [String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) | [getMessage](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/SAXException.html#getMessage())() Return a detail message for this exception. |
| [String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) | [toString](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/SAXException.html#toString())() Override toString to pick up any embedded exception. |

### Inherited Method Summary

From class [java.lang.Throwable](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Throwable.html)

|---|---|
| synchronized final void | [addSuppressed](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Throwable.html#addSuppressed(java.lang.Throwable))([Throwable](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Throwable.html) exception) Appends the specified exception to the exceptions that were suppressed in order to deliver this exception. |
| synchronized [Throwable](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Throwable.html) | [fillInStackTrace](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Throwable.html#fillInStackTrace())() Fills in the execution stack trace. |
| synchronized [Throwable](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Throwable.html) | [getCause](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Throwable.html#getCause())() Returns the cause of this throwable or `null` if the cause is nonexistent or unknown. |
| [String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) | [getLocalizedMessage](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Throwable.html#getLocalizedMessage())() Creates a localized description of this throwable. |
| [String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) | [getMessage](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Throwable.html#getMessage())() Returns the detail message string of this throwable. |
| StackTraceElement\[\] | [getStackTrace](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Throwable.html#getStackTrace())() Provides programmatic access to the stack trace information printed by `https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Throwable.html#printStackTrace()`. |
| synchronized final [Throwable\[\]](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Throwable.html) | [getSuppressed](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Throwable.html#getSuppressed())() Returns an array containing all of the exceptions that were suppressed, typically by the `try`-with-resources statement, in order to deliver this exception. |
| synchronized [Throwable](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Throwable.html) | [initCause](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Throwable.html#initCause(java.lang.Throwable))([Throwable](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Throwable.html) cause) Initializes the *cause* of this throwable to the specified value. |
| void | [printStackTrace](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Throwable.html#printStackTrace())() Prints this throwable and its backtrace to the standard error stream. |
| void | [printStackTrace](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Throwable.html#printStackTrace(java.io.PrintWriter))([PrintWriter](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/PrintWriter.html) s) Prints this throwable and its backtrace to the specified print writer. |
| void | [printStackTrace](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Throwable.html#printStackTrace(java.io.PrintStream))([PrintStream](https://developers.google.com/j2objc/javadoc/jre/reference/java/io/PrintStream.html) s) Prints this throwable and its backtrace to the specified print stream. |
| void | [setStackTrace](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Throwable.html#setStackTrace(java.lang.StackTraceElement[]))(StackTraceElement\[\] stackTrace) Sets the stack trace elements that will be returned by `https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Throwable.html#getStackTrace()` and printed by `https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Throwable.html#printStackTrace()` and related methods. |
| [String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) | [toString](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Throwable.html#toString())() Returns a short description of this throwable. |

From class [java.lang.Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html)

|---|---|
| [Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html) | [clone](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#clone())() Creates and returns a copy of this `Object`. |
| boolean | [equals](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#equals(java.lang.Object))([Object](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html) obj) Compares this instance with the specified object and indicates if they are equal. |
| void | [finalize](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#finalize())() Invoked when the garbage collector has detected that this instance is no longer reachable. |
| final [Class](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Class.html)\<?\> | [getClass](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#getClass())() Returns the unique instance of `https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Class.html` that represents this object's class. |
| int | [hashCode](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#hashCode())() Returns an integer hash code for this object. |
| final void | [notify](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#notify())() Causes a thread which is waiting on this object's monitor (by means of calling one of the `wait()` methods) to be woken up. |
| final void | [notifyAll](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#notifyAll())() Causes all threads which are waiting on this object's monitor (by means of calling one of the `wait()` methods) to be woken up. |
| [String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) | [toString](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#toString())() Returns a string containing a concise, human-readable description of this object. |
| final void | [wait](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#wait(long,%20int))(long timeout, int nanos) Causes the calling thread to wait until another thread calls the `notify()` or `notifyAll()` method of this object or until the specified timeout expires. |
| final void | [wait](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#wait(long))(long timeout) Causes the calling thread to wait until another thread calls the `notify()` or `notifyAll()` method of this object or until the specified timeout expires. |
| final void | [wait](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Object.html#wait())() Causes the calling thread to wait until another thread calls the `notify()` or `notifyAll()` method of this object. |

## Public Constructors

#### public
**SAXException**
()

Create a new SAXException.

#### public
**SAXException**
([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) message)

Create a new SAXException.

##### Parameters

| message | The error or warning message. |
|---|---|

#### public
**SAXException**
([Exception](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Exception.html) e)

Create a new SAXException wrapping an existing exception.

The existing exception will be embedded in the new
one, and its message will become the default message for
the SAXException.

<br />

##### Parameters

| e | The exception to be wrapped in a SAXException. |
|---|---|

#### public
**SAXException**
([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) message, [Exception](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Exception.html) e)

Create a new SAXException from an existing exception.

The existing exception will be embedded in the new
one, but the new exception will have its own message.

<br />

##### Parameters

| message | The detail message. |
| e | The exception to be wrapped in a SAXException. |
|---|---|

## Public Methods

#### public [Exception](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Exception.html)
**getException**
()

Return the embedded exception, if any.

##### Returns

- The embedded exception, or null if there is none.

#### public [String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html)
**getMessage**
()

Return a detail message for this exception.

If there is an embedded exception, and if the SAXException
has no detail message of its own, this method will return
the detail message from the embedded exception.

<br />

##### Returns

- The error or warning message.

#### public [String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html)
**toString**
()

Override toString to pick up any embedded exception.

##### Returns

- A string representation of this exception.