# SAXParseException

public class **SAXParseException** extends [SAXException](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/SAXException.html)  
Encapsulate an XML parse 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 exception may include information for locating the error
in the original XML document, as if it came from a `https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/Locator.html`
object. Note that although the application
will receive a SAXParseException as the argument to the handlers
in the `https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/ErrorHandler.html` interface,
the application is not actually required to throw the exception;
instead, it can simply read the information in it and take a
different action.

Since this exception is a subclass of `https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/SAXException.html`, it inherits the ability to wrap another exception.

<br />

##### See Also

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

### Public Constructor Summary

|---|---|
|   | [SAXParseException](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/SAXParseException.html#SAXParseException(java.lang.String,%20org.xml.sax.Locator))([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) message, [Locator](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/Locator.html) locator) Create a new SAXParseException from a message and a Locator. |
|   | [SAXParseException](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/SAXParseException.html#SAXParseException(java.lang.String,%20org.xml.sax.Locator,%20java.lang.Exception))([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) message, [Locator](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/Locator.html) locator, [Exception](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Exception.html) e) Wrap an existing exception in a SAXParseException. |
|   | [SAXParseException](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/SAXParseException.html#SAXParseException(java.lang.String,%20java.lang.String,%20java.lang.String,%20int,%20int))([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) message, [String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) publicId, [String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) systemId, int lineNumber, int columnNumber) Create a new SAXParseException. |
|   | [SAXParseException](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/SAXParseException.html#SAXParseException(java.lang.String,%20java.lang.String,%20java.lang.String,%20int,%20int,%20java.lang.Exception))([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) message, [String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) publicId, [String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) systemId, int lineNumber, int columnNumber, [Exception](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Exception.html) e) Create a new SAXParseException with an embedded exception. |

### Public Method Summary

|---|---|
| int | [getColumnNumber](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/SAXParseException.html#getColumnNumber())() The column number of the end of the text where the exception occurred. |
| int | [getLineNumber](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/SAXParseException.html#getLineNumber())() The line number of the end of the text where the exception occurred. |
| [String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) | [getPublicId](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/SAXParseException.html#getPublicId())() Get the public identifier of the entity where the exception occurred. |
| [String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) | [getSystemId](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/SAXParseException.html#getSystemId())() Get the system identifier of the entity where the exception occurred. |

### Inherited Method Summary

From class [org.xml.sax.SAXException](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/SAXException.html)

|---|---|
| [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. |

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
**SAXParseException**
([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) message, [Locator](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/Locator.html) locator)

Create a new SAXParseException from a message and a Locator.

This constructor is especially useful when an application is
creating its own exception from within a `https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/ContentHandler.html` callback.

<br />

##### Parameters

| message | The error or warning message. |
| locator | The locator object for the error or warning (may be null). |
|---|---|

##### See Also

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

#### public
**SAXParseException**
([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) message, [Locator](https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/Locator.html) locator, [Exception](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Exception.html) e)

Wrap an existing exception in a SAXParseException.

This constructor is especially useful when an application is
creating its own exception from within a `https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/ContentHandler.html` callback, and needs to wrap an existing exception that is not a
subclass of `https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/SAXException.html`.

<br />

##### Parameters

| message | The error or warning message, or null to use the message from the embedded exception. |
| locator | The locator object for the error or warning (may be null). |
| e | Any exception. |
|---|---|

##### See Also

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

#### public
**SAXParseException**
([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) message, [String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) publicId, [String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) systemId, int lineNumber, int columnNumber)

Create a new SAXParseException.

This constructor is most useful for parser writers.

All parameters except the message are as if
they were provided by a `https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/Locator.html`. For example, if the
system identifier is a URL (including relative filename), the
caller must resolve it fully before creating the exception.

<br />

##### Parameters

| message | The error or warning message. |
| publicId | The public identifier of the entity that generated the error or warning. |
| systemId | The system identifier of the entity that generated the error or warning. |
| lineNumber | The line number of the end of the text that caused the error or warning. |
| columnNumber | The column number of the end of the text that cause the error or warning. |
|---|---|

#### public
**SAXParseException**
([String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) message, [String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) publicId, [String](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/String.html) systemId, int lineNumber, int columnNumber, [Exception](https://developers.google.com/j2objc/javadoc/jre/reference/java/lang/Exception.html) e)

Create a new SAXParseException with an embedded exception.

This constructor is most useful for parser writers who
need to wrap an exception that is not a subclass of
`https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/SAXException.html`.

All parameters except the message and exception are as if
they were provided by a `https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/Locator.html`. For example, if the
system identifier is a URL (including relative filename), the
caller must resolve it fully before creating the exception.

<br />

##### Parameters

| message | The error or warning message, or null to use the message from the embedded exception. |
| publicId | The public identifier of the entity that generated the error or warning. |
| systemId | The system identifier of the entity that generated the error or warning. |
| lineNumber | The line number of the end of the text that caused the error or warning. |
| columnNumber | The column number of the end of the text that cause the error or warning. |
| e | Another exception to embed in this one. |
|---|---|

## Public Methods

#### public int
**getColumnNumber**
()

The column number of the end of the text where the exception occurred.

The first column in a line is position 1.

<br />

##### Returns

- An integer representing the column number, or -1 if none is available.

##### See Also

- `https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/Locator.html#getColumnNumber()`

#### public int
**getLineNumber**
()

The line number of the end of the text where the exception occurred.

The first line is line 1.

<br />

##### Returns

- An integer representing the line number, or -1 if none is available.

##### See Also

- `https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/Locator.html#getLineNumber()`

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

Get the public identifier of the entity where the exception occurred.

##### Returns

- A string containing the public identifier, or null if none is available.

##### See Also

- `https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/Locator.html#getPublicId()`

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

Get the system identifier of the entity where the exception occurred.

If the system identifier is a URL, it will have been resolved
fully.

<br />

##### Returns

- A string containing the system identifier, or null if none is available.

##### See Also

- `https://developers.google.com/j2objc/javadoc/jre/reference/org/xml/sax/Locator.html#getSystemId()`