oracle.xml.util

## Class XMLException

- java.lang.Object
- - java.lang.Throwable
  - - java.lang.Exception
    - - oracle.xml.util.XMLException

All Implemented Interfaces:
  java.io.Serializable

Direct Known Subclasses:
  XSLException

    public class XMLException
    extends java.lang.Exception

Indicates that a parsing exception occurred while processing an XML document

See Also:
  Serialized Form

### Field Summary

Fields
`static int` `ERROR` Code for non-fatal error
`static int` `FATAL_ERROR` Code for fatal error
`static int` `WARNING` Code for warning

### Constructor Summary

Constructors
Constructor and Description
`XMLException(java.lang.String mesg, java.lang.String pubId, java.lang.String sysId, int line, int col, int type)`
`XMLException(java.lang.String mesg, java.lang.Throwable ex)`
`XMLException(XMLError err, java.lang.Exception e)`
`XMLException(XMLError err, int firsterr)`
`XMLException(XMLError err, int firsterr, java.lang.Exception e)`

### Method Summary

All Methods Instance Methods Concrete Methods
`java.lang.String` `formatErrorMessage(int i)` Get the error message at specified index
`java.lang.Throwable` `getCause()` Get the cause exception
`int` `getColumnNumber(int i)` Get the column number of error at specified index
`java.lang.Exception` `getException(int i)` Get the exception (if exists) that occured in error at specified index
`int` `getLineNumber(int i)` Get the line number of error at specified index
`java.lang.String` `getMessage(int i)` Get the error message at specified index
`int` `getMessageType(int i)` Get the type of the error message at specified index
`int` `getNumMessages()` Return the total number of errors/warnings found during parsing
`java.lang.String` `getPublicId(int i)` Get the public ID of input when error at specified index occured
`java.lang.String` `getSystemId(int i)` Get the system ID of input when error at specified index occured
`XMLError` `getXMLError()` Get XMLError object inside XMLException.
`java.lang.Throwable` `initCause(java.lang.Throwable ex)` Set the underlying exception (if exists) This overrides the super.initCause (since JDK1.4)
`void` `printStackTrace()` Prints this `Throwable` and its backtrace to the standard error stream.
`void` `printStackTrace(java.io.PrintStream s)` Prints this `Throwable` and its backtrace to the specified print stream.
`void` `printStackTrace(java.io.PrintWriter s)` Prints this `Throwable` and its backtrace to the specified print writer.
`void` `setException(java.lang.Exception ex)` Set the underlying exception (if exists)
`java.lang.String` `toString()` Override toString to pick up any embedded exception.

### Methods inherited from class java.lang.Throwable

`addSuppressed, fillInStackTrace, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, setStackTrace`

### Methods inherited from class java.lang.Object

`equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Field Detail

#### ERROR

    public static final int ERROR

Code for non-fatal error

See Also:
  Constant Field Values

#### FATAL_ERROR

    public static final int FATAL_ERROR

Code for fatal error

See Also:
  Constant Field Values

#### WARNING

    public static final int WARNING

Code for warning

See Also:
  Constant Field Values

### Constructor Detail

#### XMLException

    public XMLException(java.lang.String mesg,
                        java.lang.Throwable ex)

#### XMLException

    public XMLException(java.lang.String mesg,
                        java.lang.String pubId,
                        java.lang.String sysId,
                        int line,
                        int col,
                        int type)

#### XMLException

    public XMLException(XMLError err,
                        int firsterr)

#### XMLException

    public XMLException(XMLError err,
                        int firsterr,
                        java.lang.Exception e)

#### XMLException

    public XMLException(XMLError err,
                        java.lang.Exception e)

### Method Detail

#### getNumMessages

    public int getNumMessages()

Return the total number of errors/warnings found during parsing

Returns:
  The number of errors/warnings

#### getMessage

    public java.lang.String getMessage(int i)

Get the error message at specified index

Returns:
  The error message

#### formatErrorMessage

    public java.lang.String formatErrorMessage(int i)

Get the error message at specified index

Returns:
  The error message

#### getLineNumber

    public int getLineNumber(int i)

Get the line number of error at specified index

Returns:
  The line number

#### getColumnNumber

    public int getColumnNumber(int i)

Get the column number of error at specified index

Returns:
  The column number

#### getSystemId

    public java.lang.String getSystemId(int i)

Get the system ID of input when error at specified index occured

Returns:
  The system ID

#### getPublicId

    public java.lang.String getPublicId(int i)

Get the public ID of input when error at specified index occured

Returns:
  The public ID

#### getException

    public java.lang.Exception getException(int i)

Get the exception (if exists) that occured in error at specified index

Returns:
  The exception

#### getCause

    public java.lang.Throwable getCause()

Get the cause exception

Overrides:
  `getCause` in class `java.lang.Throwable`
Returns:
  The exception

#### getMessageType

    public int getMessageType(int i)

Get the type of the error message at specified index

Returns:
  The error message type

#### printStackTrace

    public void printStackTrace()

Prints this `Throwable` and its backtrace to the standard error stream.

Overrides:
  `printStackTrace` in class `java.lang.Throwable`

#### printStackTrace

    public void printStackTrace(java.io.PrintStream s)

Prints this `Throwable` and its backtrace to the specified print stream.

Overrides:
  `printStackTrace` in class `java.lang.Throwable`

#### printStackTrace

    public void printStackTrace(java.io.PrintWriter s)

Prints this `Throwable` and its backtrace to the specified print writer.

Overrides:
  `printStackTrace` in class `java.lang.Throwable`

#### toString

    public java.lang.String toString()

Override toString to pick up any embedded exception.

Overrides:
  `toString` in class `java.lang.Throwable`
Returns:
  A string representation of this exception.

#### setException

    public void setException(java.lang.Exception ex)

Set the underlying exception (if exists)

Parameters:
  `ex` - - The exception

#### initCause

    public java.lang.Throwable initCause(java.lang.Throwable ex)

Set the underlying exception (if exists) This overrides the super.initCause (since JDK1.4)

Overrides:
  `initCause` in class `java.lang.Throwable`
Parameters:
  `ex` - - The `Throwable` cause
Returns:
  this

#### getXMLError

    public XMLError getXMLError()

Get XMLError object inside XMLException.

Returns:
  the XMLError object.

Copyright © 2003, 2019, Oracle and/or its affiliates. All rights reserved.
Use is subject to license terms. Also see the documentation redistribution policy.
ORACLE CONFIDENTIAL
For authorized use only.
Do not distribute to third parties.